Jump to content

Sunamena

Members
  • Posts

    85
  • Joined

  • Last visited

Posts posted by Sunamena

  1. Hello, I want to have something like the WHERE command.

    A user types something, for example: "peer".

    I want a WHERE that also includes 
    "Peer" and "PeEr"  and "apeer" and "Peert.


    Is this by any chance possible?



    Thanks in advance =D

  2. :voor is an INT.

    I do use Try and Catch, but i left that out of the code (i wanted to focus on the part that did not work). =D



    And dsonesuk: Yes i did, i did it once to much =D
    And the previous one had to be a fetchAll =D


    This problem has been solved. Thanks all =D

     

  3. Hello there,

    I think you want to know how your site looks on different resolutions?
    In Chrome, you can press F12 (followed by Ctr+Shift+M) to watch any site in a different resolution (you can even simulate certain handheld devices). 

  4. Hello everyone, this is what i want to achieve:

    When someone looks in his or her Inbox, (s)he can see all messages directer to him or her.




    This is my code (the part which is needed for my question ;)):

     

     

     

    $sql = "SELECT * FROM berichten WHERE voor = :voor ORDER BY berichtid";

                        
                            $stmt = $db -> prepare($sql);
                            $stmt -> bindParam(':voor', $voor, PDO::PARAM_INT);
                        
                            $voor = $_SESSION["userID"];  
                        
                            $stmt -> execute(); 
                        
                            $result = $stmt -> fetch(PDO::FETCH_NUM);

                            $numberInResult = count($result)-1;

                         

    // THIS IS TO CHECK MY RESULTS

       print_r($result);
                                echo "<br><br><br>";
                                echo "<br><br><br>";
                                echo $numberInResult;

    // Number in results is 5. (Which is incorrect, the test person has 7 messages. The table does have 6 rows, which is why the result is 5, atleast i think.

     

    for ($i = 0; $i < $numberInResult; $i++) {
                                ?>
                                    <div class="inbox-row">
                                        <div class="inbox-data">
                                            <?php echo $result["1"]; ?>
                                        </div><!-- 
                                         --><div class="inbox-data">
                                            <?php echo $result["2"]; ?>
                                        </div><!-- 
                                         --><div class="inbox-data">
                                            <?php echo $result["5"]; ?>
                                        </div><!-- 
                                         --><div class="inbox-data">
                                            Verwijderen
                                        </div>
                                    </div>

     

     

     

     

    // And i get to see 5 times the first message send to me.
    // Which should be 7 different messages send to me.
    // I also tried to use <?php echo $result["1"][$i]; ?> , this resulted in only having a single part of the String (which was something i learned thanks to this =D)


    So I would like to know the following:

    How to SELECT ALL the messages IN that table that are directed at ME?
    I want multiple columns selected, and echo'ed.





    I would love to thank anyone who answers this question in Advance =D

  5. Hello everyone i have a few PHP questions.


    First one:

    How can I say that for each image in a specified folder, it has to place that image?
    I have 10 images in the gallery folder (tomorow it can be 12). How do i tell my code to place an <img src="filename"> for each image?


    Second question: 

    When displaying something that a user posted (example: guestbook). How can i allow ENTERS to be displayed when getting the data from the database? It always skips the enters.



    Third question: 

    How exactly can i allow users to upload a file to a certain folder (must be a jpg file). The name of the image will be modified, and it should be resized to 200 kilobyte.

     


    Fourth question:


    Can i change certain parts of the text i get from the database (example: ":)" and change it to something differently? Say: "<img src="smily.png>"?



    Thanks in advance for the answers =D
     

  6. Hello everyone.

     

    I want to create a system where people can post things. Like on this forum.

    But i am wondering. Should i save long text messages as one big and long string. Or should i use a different method? If you suggest a different method a link to a tutorial would be a big help n.n

     

    Thanks in advance kind mis or mister

  7. All i want is a simple border image as my HR.


    HTML should be:

    <hr>

    Simple enough

    CSS should be:

     

    ?

     

     

    Quite simple: ONE image as a SINGLE line, 100% height, and repeating horizontally..
    This should not be quite difficult to do. But no matter what i try, the CSS is always doing things that i do not want it to do.

    So how would your CSS look like in order to achieve this task?




    I give you my sincere gratitude in advance!

  8. There is no CSS for a screen larger than 470 pixels if i see this correctly.

    You are also working with inline css and obsolete table sub tags such as border="0" cellspacing="0" cellpadding="0".

     

    CSS gets read like this:

    Use inline CSS
    Else
    Use the css in the head
    Else
    Use the css in the linked file.

    Maybe that is what is creating the conflict?

  9. I think Javascript or PHP is required to do the trick.

    I found the following solution on the internet:

     

     

    Not tried, but this might work:

     

    <?php

    $filename = '/path/to/audio.mp3';
    if(is_file($filename))
    {
    header('Content-Type: audio/mpeg');
    header('Content-Disposition: inline;filename="'.basename($filename).'"');
    header('Content-length: '.filesize($filename));
    header('Cache-Control: no-cache');
    header("Content-Transfer-Encoding: chunked");
    readfile($filename);
    }

    ?>

     

    Basically we are outputting the raw audio stream in the location where mp3.php is called. This is also how we do it when we say <img src='img.php'>

     

     

     

     

     

    This is PHP code. So your page should be page.php

     

     

    Source: http://stackoverflow.com/questions/33581188/hide-audio-url-in-php

  10. You can also apply multiple classes like this

    <div class="cute-border nomobile">

     

    </div>

     

     

    The cute-border can give a cute border, and can be reused (like another div, ...).
    The nomobile class is one i tend to use to say:
    display: none;
    When it is on a mobile device.

     

     

     

     

    While the validators are good, they are not perfect, they sometimes see errors which arent errors. Such as


    *::selection


  11. Firstly:
    Consider the use of meta-tags in the <head> section.
    These are quite essential:
    <meta name="description" content="THIS TEXT WILL DESCRIBE THIS PAGE">
    Search engines use this as.
    "
    TITLE
    DESCRIPTION
    "
    Next result...
    <meta name="viewport" content="width=device-width">
    This makes the website easily adaptable to smaller devices, but a little more is required.
    As to the <body>
    Consider using <nav> instead of <div id="nav">.
    <nav> <main> and <footer> are new in HTML5.
    Consider changing
    "<p>Email Address: yourboijimbo@boi.com</p>"
    To
    "<p>Email Address: <a href="mailto:yourboijimbo@boi.com">yourboijimbo@boi.com</a></p>"
    This makes it possible to mail this person directly by using a mail program.
    Same for the telephone number. <a href="tel:+32NUMBER">...
    Note that +32 is a country code.
    This makes it possible to call by using Skype, or by using your smartphone.
    For your CSS: try using mobile first design.
    CREATE CSS FOR MOBILE
    @media (min-width: 680px) and (max-width: 999px) {
    CUSTOM CSS FOR TABLET (you can change min and max width to your liking)
    }
    @media (min-width: 1000px) {
    CUSTOM CSS FOR DESKTOP
    }
    Note that the Mobile CSS will always work (but can be changed thanks to screen size).
    Example: my mobile design says: width:100%, background-color: red.
    And my desktop CSS says: width:80%.
    Because the 80% is at a lowwer place, it will overwrite the 100%. But this code only applies when the screen has a width of 1000px or more. So on a smaller device, width will be 100%.
    The background-color will be red (in this example), regardless of screen width.


    #copyright {
    position: relative;
    left: 70%;
    bottom: 50px;
    font-size: 1em;
    font-size: 1vw;
    }

    Your font-size will be 1vw. The em will be overwritten (you can only have one font-size), so the 1 em is obsolete. ;)
    Your #socialmedia has a
    position: ;
    and
    top: ;
    And do not contain numbers.


    It is also a good idea to validate your HTML and CSS.
    They are not perfect but may help you see some small errors.
    CSS validator example: https://jigsaw.w3.org/css-validator/
    HTML validator example: https://validator.w3.org/
    I hope this helps you in a way. =D
  12. There is no need for three seperate CSS files. It can all fit into one file ;)


    And with a Mobile First design, you can reuse or modify content.
    Small example:


    a {
    color: green;
    }

    a:hover {
    color: red;
    }

     

    div, main, aside {
    display: inline-block;
    box-sizing: border-box;
    }

     

    .container {

    width: 100%
    }

    main {
    width: 100%;
    border-bottom: 2px solid black;
    }

    aside {
    width: 100%;
    }


    /* TABLET VIEW */

     

    @media (min-width: 680px) and (max-width: 999px) {

     

    main {

    width: 70%;
    border-bottom: none;
    }

    aside {
    width: 30%;

    border-left: 2px solid black;
    }

     

     

    }

     

     

     

    @media (min-width: 1000px) {

    .container {

    width: 80%;
    margin: auto;

    }

    }

     

     

     

    -------------------------

     

    As for a smartphone navigation, it is better to create a Desktop first navigation, and then use Smartphone nav CSS.
    Remember: CSS gets read from top to bottom.


    a {
    color: red;
    }

    a {
    color: blue
    }

    Will result in a blue color.
    Since the second will override the first.

  13. First of all i would strongly suggest using a single CSS file and try to work Mobile First.

    This means:

    First write your CSS for your Mobile Viewport.
    Then for tablets
    Then for desktops

     

    This makes it easier (as for example your color for certain div tags and a tags will be the same, width most likely varies)


    EXAMPLE:


    CSS code mobile

    @media (min-width: 680px) and (max-width: 999px) {
    CSS code tablet

    }

     

    @media (min-width: 1000px) {
    CSS code desktop
    }




    I have noticed that the device-width of iPhone 6 is 375px, and of iPhone 6 Plus is 414px.
    Both are larger than your max width, so it would give the Tablet view.
    Try right clicking and look at your code (or in short: F12) in Chrome, the settings applied might hint which stylesheet got applied.




    Off topic:
    Try to use

    <meta name="description" content="DESCRIPTION OF THIS PAGE">

    This will be the description given under the title of your page when you appear on a search engine. And it boosts your SEO ;)


    I hope this helps =D

  14. Skew did not do the trick for me (since it did not seem to be responsive). And i did not try SVG.

    However, i managed to do it with this background:

     

    header {
    background:
    linear-gradient(130deg, rgba(0,0,0,0) 93%,rgba(0,0,0,1) 93%,rgba(0,0,0,1), rgba(0,0,0,1) 93.25%,rgba(0,0,0,0) 93.25%, rgba(0,0,0,1) 150%),
    linear-gradient(50deg, rgba(0,0,0,0) 6.75%,rgba(0,0,0,1) 6.75%,rgba(0,0,0,1) 7%,rgba(0,0,0,0) 7%);
    /* background: right -> and left <- */
    But i can not seem to figure out how to fill the gap between the two lines as white (rgba(255,255,255,0.8))
    Can anyone here help me? =D


    If it is to much effort, i can probably simply use a background image =P
×
×
  • Create New...