Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by Sunamena

  1. How to Add PHP code to Bootstrap contact Form

    Your textarea and email dont have a name (HTML). Could that cause a problem?
  2. Anchor links not working

    I am currently on my mobile device so i can not check your code but i always jump to the part under guided. Are you sure the ID is at the correct place? And did you try to validate your code? Very handy to see you forgot something. https://validator.w3.org
  3. W3.CSS Vertical Tabs problem

    Image 2 is the closest to the last one (the example i presume?). The left div does not need any margin. Try adding: margin: 0; And the right div would need: vertical-align: top;
  4. W3.CSS fixed-top (dynamic) navigation bar problem

    I am not a big fan of Bootstrap, but i think this is what you are looking for: Example: https://www.w3schools.com/bootstrap/bootstrap_affix.asp Note that this is achieved by using JavaScript. You actually change the class after scrolling down.
  5. Issue with float:left

    You can try to assign a clear propperty. Like in this example: https://www.w3schools.com/css/css_float.asp I think the "try it" tackles a problem like the one you are having right now. If it still doesn't work, be sure to reply
  6. Drag immage do this

    I failed to find an example of something specific i am looking for. This is what i want: <img src="a.jpg" id="1"> <img src="a.jpg" id="2"> <img src="a.jpg" id="3"> <img src="b.jpg" id="dragable-1"> <img src="b.jpg" id="dragable-2"> When a draggable image (as seen in the ID), gets dragged onto another image i want this to happen: <a href="mylink.php?draggable=IDDRAGGABLE1&to=IDOFTHEIMMAGEITGOTDROPPEDINTO"></a> Can i find any tutorial on this? Is this difficult? Thanks in advance =D
  7. Drag immage do this

    Thankyou very much! =D
  8. Select and array

    Hello everyone I have a small problem with my code. I will show the most important parts of it and hope you guys can assist me This is my code: $sql = "SELECT * FROM brusers WHERE userName = '$userName' AND password = '$wachtwoord'"; // Vraag alle resultaten op $stmt = $con -> prepare($sql); $deelStap=mysqli_query($con,$sql); $result=mysqli_fetch_all($deelStap,MYSQLI_NUM); // of: $result=mysqli_fetch_all($deelStap,MYSQLI_NUM); print_r($deelStap); This is the print_r: mysqli_result Object ( [current_field] => 0 [field_count] => 12 [lengths] => [num_rows] => 0 [type] => 0 ) When i print_r($result) i get an empty array. How do i get $result as an array? I am used to using PDO (i like it alot), my PDO code works fine on my localhost: -- Connect with databasw with PDO $db = new PDO('mysql:host=localhost:3307;dbname=handikrap', 'root', 'usbw'); $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); --- code $sql = "SELECT userID, userName, type, ban, laatstIngelogd, inlogPogingen FROM users WHERE userName = :userName AND passWord = :wachtwoord"; $stmt = $db -> prepare($sql); $stmt -> bindParam(':userName', $userName, PDO::PARAM_INT); $stmt -> bindParam(':wachtwoord', $wachtwoord, PDO::PARAM_INT); $userName = htmlspecialchars($_POST["userName"]); $wachtwoord = htmlspecialchars(sha1($_POST["wachtwoord"])); $stmt -> execute(); $row = $stmt -> fetch(PDO::FETCH_NUM); but seems to not be supported on the webhost of one.com. Or did i do something wrong? Should i stick with PDO or move on to mySqli? They use MariaDB on one.com. Thanks in advance
  9. Select and array

    Thankyou very much for your reply! Well, I will stick with PDO then. I managed to find a solution to make it work with PDO (and I am happy with that ). I did get error messages, but not anymore. I think the problem was on my end (or i was not patient enough). At the top of my document, to keep it organised i check all my input from the post. For the password i hash with sha1. Should i adopt using password_hash instead?
  10. What is wrong with this code

    Hey all, I have created a website on my local host. Now that i try to upload it, i get many errors. Such as this one: $result = $stmt -> fetchAll(PDO::FETCH_NUM); ERROR: Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetchAll() in /customers/c/5/e/sunamena.be/httpd.www/eldiemus/nieuws.php:290 Stack trace: #0 {main} thrown in /customers/c/5/e/sunamena.be/httpd.www/eldiemus/nieuws.php on line 290 And will this still be valid? $stmt -> bindParam(':datum', $datum, PDO::PARAM_INT); I also had to change my connection method from $db = new PDO('mysql:host=urlToDatabasel;dbname=DatabaseName', 'DatabaseName', 'NotARealPassword'); $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); to $con=mysqli_connect("sunamena.be.mysql", "sunamena_be", "s6X6tyUj", "sunamena_be"); This is still save to use without the setAttribute?
  11. What is wrong with this code

    The new code should be MySqli $sql="SELECT * FROM nieuws ORDER BY nieuwsID desc"; $deelStap=mysqli_query($con,$sql); $result=mysqli_fetch_all($deelStap,MYSQLI_NUM); $numberInResult = count($result); But how to fetch one?
  12. Issue with image upload

    Hello everyone, I have an issue with uploading an image, but i can not seem to figure out what might be the problem. I am new to adding images. I would like to thank you all in advance for your asistance =D This is the PHP code: And this is the form
  13. Issue with image upload

    Thanks. This problem has been solved =D
  14. Problem with Flexbox

    Hello everyone. The Flexbox design I am currently working on, is working fine as you can see here: http://bronies.be/example/index.html But there is an error on the following pages: http://bronies.be/example/contact.php It does not cover the full width. And even worse here: http://bronies.be/example/404.html It does not even show the aside image. Disclaimer: This is a work in progress. Only parts of the website have been uploaded in order to ask this question. I notice that this happens on pages with little content. But i do not want this to happen, but it does. What am I exactly doing wrong? Thanks in advance for your assistance!
  15. Add text when click on

    This is currently my Function: function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.innerHTML += text; } And this is my onclick: onclick="insertText('bericht', 'mytext');" What it needs to do is add mytext at the END of the current text in my Textarea. This function works, but as soon as i enter something IN the textarea, the function stops working. Does anyone here know how to solve this issue?
  16. Link colours

    Your code is fine. It works over here. Did you try it in different browsers? I used Chrome. Remember, if you ever visited the page, the color will be selected FROM visited, and not from link. Delete your cookies, close your browser, or try to type a link to a website your sure you have not yet visited.
  17. How to remove tr from a table

    As dsonesuk sayd: you have to select them and then assign css to them. For example i have <td class="dontShow"> on my website. I do not want this cell to be seen. I have two options in CSS. .dontShow { Display: none; } Or .dontShow { Visibility: hidden; } The difference is, that display none will remove it from your webpage and the visibility will just make it not be there, but it will still take up the space as if it did exist.
  18. Add text when click on

    Strange something: It does indeed work like this: <head> ,,, <script type="text/javascript"> function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.value += (' ' + text); } </script> ... </head> But i encounter the issues when i do this: <head> ... <script src="js/mylibrary.js"></script> ... </head
  19. Alternative for WHERE?

    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
  20. Alternative for WHERE?

    Thanks, this works =D it seems that %s% Includes S and s. =D
  21. Add text when click on

    As soon as i start typing in the textarea and press the image with the onclick command, it stops functioning. Both innerHTML and value put the content IN the textarea, but NOT anymore once any action has been preformed inside the textarea (such as deleted or typed something)
  22. Trying to Create Image Grid w/ Hover

    Is a flexbox what you are looking for? With a flexbox you can easily grid content. And i find it easy to get it responsive. Here you can find a step by step guide. https://css-tricks.com/snippets/css/a-guide-to-flexbox/
  23. how do i do this

    Is it possible to share the HTML and CSS code required for your entire canvas? That way we can better see and help solve your issue
  24. Issues with Multidimensional array

    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
  25. Issues with Multidimensional array

    :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