Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. westman

    array in mysqli query

    Thank you for your support. I really appropriate it. I am having a problem with this line... while($row = $result->fetch(PDO::FETCH_ASSOC)) {
  3. dsonesuk

    action_page.php

    Wha? Same way you would with multiple input types, 'name' attributes with different 'name' attribute values
  4. Today
  5. ameliabob

    action_page.php

    Is there a way that I can view the action_page.php so I can see what the server side looks like for a submit button? Also How do I differentiate between multiple submit buttons?
  6. Ingolme

    array in mysqli query

    First, you have to use prepared statements to send data to your queries. If you don't it's highly likely that some unexpected data will cause errors in your query and break your program and in the worst case scenario this can be used to hack your website. You can use the IN() operator to compare a field to multiple values. This works best in PDO, where you can pass parameters as arrays: <?php $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // Set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Build a string of placeholders like ?,?,?,?, one for each array element. $amount = count($uniqueValueArray_id); $placeholders = array_fill(0, $amount, '?'); $search = implode(',', $placeholders); // Prepare the statement $limit = 5; // Make absolutely sure this value is an integer or the program will break $stmt = $conn->prepare("SELECT id, text, date, FROM text WHERE id IN ($search) ORDER BY id DESC LIMIT $limit"); // Run the statement, passing in the values $result = $stmt->execute($uniqueValueArray_id); while($row = $result->fetch(PDO::FETCH_ASSOC)) { // Display the result here however you want print_r($row); }
  7. westman

    array in mysqli query

    $seach = ''; foreach ($uniqueValueArray_id as $key => $value) { $seach .= 'id='.$value; $seach .= ' OR '; } $seach = rtrim($seach,' OR '); echo $seach; $sql = "SELECT id, text, date, FROM text WHERE $seach ORDER BY id DESC $limit"; $query = mysqli_query($conn, $sql); I am getting closer but I do have a problem with the query still. Any help?
  8. westman

    array in mysqli query

    Is it even possible to run an array through a query?
  9. westman

    array in mysqli query

    $uniqueValueArray[] = $mainRow; // my array $sql = "SELECT id, text, date FROM text WHERE id='My Array' ORDER BY id DESC $limit"; $query = mysqli_query($conn, $sql); How do I make a query look for an array?
  10. dsonesuk

    Jquery - function when resizing window

    The idea is to make CSS media queries control what menus and styling is used, then use JavaScript to reset menu state (collapse) on resize. The menu click should use single click event to toggle, OR on clicking of element identify what state the menu is (collapsed or not), then do the opposite. You need to let CSS control as much as possible of the menu and styling of the page, since with media queries and CSS3 new features means more of this is possible.
  11. philipp

    Problem with background video in Chrome browser

    <video width="100%" height="100%" autoplay loop> <source src="https://hostpart.ch/Beach - 14297.mp4" type="video/mp4" />Your browser does not support the video tag. I suggest you upgrade your browser. <source src="https://hostpart.ch" type="video/webm" />Your browser does not support the video tag. I suggest you upgrade your browser. Your browser does not support the video tag. </video> oder <div class="homepage-hero-module"> <div class="video-container"> <div class="filter"></div> <video autoplay loop class="fillWidth"> <source src="https://hostpart.ch/Beach - 14297.mp4" type="video/mp4" />Your browser does not support the video tag. I suggest you upgrade your browser. <source src="https://hostpart.ch" type="video/webm" />Your browser does not support the video tag. I suggest you upgrade your browser. </video> <div class="poster hidden"> <img src="https://hostpart.ch/Beach - 14297.mp4" alt=""> </div> </div> </div> Both codes work, just not in CHROME.
  12. Ingolme

    Problem with background video in Chrome browser

    I can't help without seeing what code you used to put a video into the background.
  13. Hello can someone help me? I have a background video embedded with a placeholder on the web page. Works great in most browsers, just not in Chrome. Is there a solution for this? Thank you very much
  14. Nic727

    Jquery - function when resizing window

    Ok I have the answer: if($(".mobile-menu").click(function(){ $(".right-menu").addClass("Collapse"); $(".fas.fa-times").addClass("Collapse-x"); })); if($(".close-mobile-menu").click(function(){ $(".right-menu").removeClass("Collapse"); $(".fas.fa-times").removeClass("Collapse-x"); })); if ($(window).on('resize', function () { // console.log($(this).width()) if($(window).width() > 840){ $(".right-menu").removeClass("Collapse"); $(".fas.fa-times").removeClass("Collapse-x"); } })); 1. I changed to class for now, but maybe I will change back to inline-style since I didn't have a lot... 2. I guess I can remove all the "if" statement right? A bit useless...
  15. Hi, I'm making a mobile menu on my website and I have a problem. When making my browser window reaching 840px and smaller, the hamburger icon is showing. I click on it and my menu is appearing, but if I keep the menu open and go back to a window bigger than 840px I have two bugs: 1. If I close the mobile menu, it make items opacity 0. So when returning to normal menu, items are still transparent. 2. If I keep mobile menu open and go back to normal menu, menu is showing… Ok, but when returning back to smaller screen, mobile menu is still here. I tried something like that, but it doesn't work. if ($(window).width() <= 840) { $(".mobile-menu").click(function(){ $(".right-menu").height('100%').css({ opacity: 1 }); $(".fas.fa-times").css({ top:'50px' }); }); $(".close-mobile-menu").click(function(){ $(".right-menu").height('0%').css({ opacity: 0 }); $(".fas.fa-times").css({ top:'-50px' }); });}else{ $("right-menu" && ".fas.fa-times").removeAttr('style'); } The last part of the code is supposed to make inline-style disappear, but it doesn't because it doesn't activate the function when resizing, but only when it's loading at a higher screen width. Is there a way to make this work when resizing to window width higher than 840? Thank you
  16. Yesterday
  17. gordonisnz

    CSS3 - Trying to center a menu.

    Found it - w3-center (in the 'text' part of the site.. https://www.w3schools.com/w3css/w3css_text.asp ) - i was thinking of it as a menu, not plain text
  18. gordonisnz

    CSS3 - Trying to center a menu.

    https://www.w3schools.com/w3css/w3css_navigation.asp Hello. I'm trying to do a BASIC (see above site for example) navigation on my site - Its working fine, however the div/container fills 100% of the width of the screen. Has anyone got an example of how to do a navigation - But if the text/wording does NOT fill up the entire width of the screen - it automatically centers. Ive used width:auto; and text-align center etc - but nothing works. I CAN make the div smaller (say 50%), and the text is centered, But if i add more menu items, the text word-wraps for half the screen instead of going the full width of the screen. ALSO, who / how do we contact the designers of the above website to add an example of how to center a menu. SO FAR i have: <div class="w3-display-container" style="width:75%; margin-left: auto; margin-right: auto; text-align: center;"> <div class="w3-bar w3-display-topmiddle"> <span class="w3-bar-item">Select a letter: &nbsp; </span> <a href="/letter/p" class="w3-bar-item w3-button w3-mobile">p</a> <a href="/letter/r" class="w3-bar-item w3-button w3-mobile">r</a> <a href="/letter/w" class="w3-bar-item w3-button w3-mobile">w</a> </div> </div>
  19. It took some time to find it, but I was finally able. Unfortunately, I was unable to find anything in Chrome, and I have long since given up on Safari, as it is next to useless in my current operating environment. The following is the procedure used to display the structure and contents of a result object that is generated in a PHP file called with an AJAX request. Open the Firefox Console and find the Network tab. While in the Network tab find the javascript (.js) file responsible for calling the PHP file that generates the JSON object. Highlight the file by clicking on it. While the file is still highlighted click on the XHR tab. This will cause the relevant .php file(s) to appear below the highlighted .js file. Click on the PHP file of interest and find the Response tab in the appropriate corresponding box. It is in the viewport of this box that the object appears. Click on the various objects, arrays, and other components of the object to learn how it is structured and to display the values. Have a great weekend! Roddy
  20. ProfBurnett

    Joint Certification

    Hello, I’m a professor at Montgomery College, Maryland and I am the lead instructor for all web development courses for the Information Technology Institute (ITI). ITI training is specifically designed for workforce development courses (non-credit) and not matriculating credit courses. The courses are designed for working professionals. I use W3Schools for many of my training materials. Students love the interactive exercises and use the interactive tools to provide hybrid course material so students can continue to learn after the formal instruction is completed or while they are at home. The reason for this inquiry is to open up a discussion about setting up a joint certification program for the college and W3Schools. I believe more students would get certified if both the Montgomery College, ITI and W3Schools were the certifying agencies. Please contact me at carl.burnett@montgomerycollege.edu.
  21. iwato

    How to Prepend Zeros to a Numerical Value

    So, in conclusion, .pad(size) is a user-created method of a primitive Number object that is called via the Number.prototype property and executed by either the parentheses operator or variable assignment. Do I have everyone's agreement. Roddy
  22. iwato

    Dysfunctional Dynamically Introduced Stylesheet

    Oh well, infinity wins out. For, it is only bounded by the imagination, and it seems to be without end. At least, until I die, and someone else's carries on. Roddy
  23. Ingolme

    Dysfunctional Dynamically Introduced Stylesheet

    That is not a contradiction. The width is restricted to any value less than or equal to 100% of its parent's width. It is not allowed to be 200% or 400%. The range of valid values used to be from 0 to infinity, we have restricted it to the range [0, 100].
  24. iwato

    Dysfunctional Dynamically Introduced Stylesheet

    PRAISE and ADORATION: I would like to thank you for a very wonderful post. It was very readable and hence very helpful. So much so that I have created a private webpage to capture its insight. Also, my URLs no longer extent beyond the <fieldset: element in which they are contained. Hooray! Hooray! iRONY: Although I understand fully what is meant by the following, it is only because I have worked long enough with CSS to get the gist. Taken at its face value this statement is completely contradictory: This is CSS in a "nut"-shell. Roddy
  25. dsonesuk

    Missing display

    Don't use position: absolute; unless you can't achieve same result using float, margins, padding, display instead. header using position: absolute; occupies no space, so other elements move in to occupy that space instead, your input parent div has moved up behind the header content.
  26. ameliabob

    Missing display

    I am just getting restarted and am having problems finding syntax problems <code> <!DOCTYPE html > <html > <head> <style> body {margin:0;font-family:"Trebuchet MS", "Arial Black", "Verdana", "Helvetica", sans-serif;} #seltype {font:36px} #header {background:blue; color:white; position:absolute; top:0;left:0px;right:0;margin:0;text-align:center;font-family:"Trebuchet MS", "Arial Black", "Verdana", "Helvetica", sans-serif;font-weight:bold; white-space: nowrap;} #header h1, #header p {padding:2px 20px 2px 100px;margin:0} #hdgline {text-align:center; font-size:1.875em;} button {font:24px "Trebuchet MS", "Verdana", sans-serif;background:#F9CC7D;border:outset #F9CC7D} </style> <title>Year to Date P/L</title> </head> <body> <div id="header"> <p><br /></p> <h1 id="hdgline" style="font-size:36px">Year to Date P/L</h1> <p><br /></p> <button onclick='AddTrade()' >Enter Trade</button> <button onclick='ExitTrade()' >Exit Trade</button> <button onclick='ShowPL()' >Show P/L</button> </div> <div id="cond"> <p> <input type="text" name="first" value="me"></br> </p> </div> </body> </html> </code> The input line does not display. The buttons do. What am I missing?? Thanks
  27. Last week
  28. Ingolme

    Dysfunctional Dynamically Introduced Stylesheet

    About CSS and rule precedence CSS is currently the best system we have for easily creating flexible layouts. Some people might hate CSS but I'd like to see if they can come up with a better alternative. CSS rules are chosen based on how specific the selectors are. In general the following rules apply: A rule with an ID selector always has precedence over a rule without one. A more specific rule has precedence over a less specific one, that is when the selector has more pieces in it. If two rules are still the same after the previous tests, the last rule has precedence. This works across stylesheets and in the document as well. To get more details you can read this article: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity The solution to your specific issue The issue here does not seem to be with precedence, though, it's actually a combination of a lot of small things. First, due to browsers very unusual way to render fieldsets, you need to set the min-width of your fieldsets to make them behave like normal boxes: #yp_container fieldset { min-width: 0; } The second thing is that you have to restrict your box's width so that the text is not given the opportunity to not wrap. If it's allowed to stretch the box, it will do that instead of wrapping, so we'll set the max-width of the box to 100%. #current_referral_url { max-width: 100%; } Finally, you made a mistake: The overflow-wrap property should be set to break-word. The normal behaviour is to not break. #current_referral_url { max-width: 100%; overflow-wrap: break-word; } A word about using IDs as selectors I would recommend not using IDs in your selectors if you have any other option. IDs are very powerful and as you know, with great power comes great responsibility. When you use an ID selector to set the style of an element, you make it terribly difficult for rules anywhere else to override your style. If you are going to use an ID selector, you should be sure to use it to only set properties that are very special to the element, which in most cases none of them are that special. It's a good idea to make all your selectors as weak as possible, you never know when you want to override them. A word about usability in your website I haven't had a good moment to tell you this, but your website has a severe usability problem and you have already been experiencing its negative effects. Every time you want somebody to get to a specific page on your site, you find yourself forced to give a long list of instructions on how to get there. This is a problem, there should be unique URLs to get people to land on any part of the site in just one click.
  29. Ingolme

    How to Prepend Zeros to a Numerical Value

    As far as I know, numbers in Javascript are natively objects, everything is an object actially. There's just a syntax problem when doing 2.method() because the meaning of the dot is ambiguous until reading further, it could be indicating a decimal point. This works in the Javascript console: var x = 5; x.toString(); // Prints "5" Edit: There is actually some kind of distinction between primitives and the object representations of them, but anytime you call a method on a primitive the Javascript engine automatically creates an object representation of it. This MDN document has a short section about it. While the document is talking about strings it applies to all primitives.
  1. Load more activity
×