Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 05/25/2019 in all areas

  1. 2 points
    You should call exit or die any time you're redirecting a user to prevent the code from executing any of the instructions that are further down. Nothing about the header() function tells the code to stop executing. header('Location: /Logon/Logon.php?From=Home'); exit;
  2. 2 points
    Use flex box <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Document Title</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content=""> <!--<link rel="stylesheet" href="css/styles.css?v=1.0"> --> <style> *{box-sizing: border-box;} .layout-wrap { display: flex; min-height: calc(1px + 40vw);} .layout-col1{ display: flex; flex: 1 1 100%; max-width: 40%;} .layout-col2{display: flex; flex: 1 1 100%; max-width: 60%; flex-wrap: wrap; justify-content: space-evenly; } .layout-col2 >div, .layout-col1 >div { margin: 10px; border: 3px solid #000;} .div1 {flex: 1 1 auto;} .div2 { flex: 1 1 auto; max-width: 40%; margin-right: 5px;} .div3 { flex: 1 1 auto; max-width: 60%; margin-left: 5px;} .div4 { flex: 1 1 100%; max-width: calc(100% - 20px);} </style> </head> <body> <!--<script src="js/scripts.js"></script> --> <div class="layout-wrap"> <div class="layout-col1"> <div class="div1"></div> </div> <div class="layout-col2"> <div class="div2"></div> <div class="div3"></div> <div class="div4"></div> </div> </div> </body> </html>
  3. 1 point
    Surprisingly, we get people putting their usernames as a topic title quite frequently. I don't know why.
  4. 1 point
    Every anchor element requires a closing tag of </a>, which you have missed in the first unordered list items. So it seeps to envelope other elements.
  5. 1 point
    What error message? You must not declare it inside the loop. Only outside. It's been a while since I last programmed in C# so I don't remember if it requires variables to be initialized. If it does, just initialize it to an empty string. string userName4 = ""; It has to be done outside of the loop.
  6. 1 point
    I don't how css can do that as its presentational, the most it can do is show text using :before and :after a link address. There is a base tag which would have the http domain and default root folder, you then must have relative paths without domain and root folder. https://www.w3schools.com/tags/tag_base.asp
  7. 1 point
    As far as I can make out reading the post made, he wants the opposite.
  8. 1 point
    I see. You will need some special logic to run between Thursday and Saturday. It will use 60 hours but only after 12pm on Thursday. var THURSDAY = 4; var minDate = new Date(); var offset = 36; if(minDate.getDay() > THURSDAY || minDate.getDay() == THURSDAY && minDate.getHours() >= 12) { // Add 60 hours instead of 36 after noon on Thursday offset = 60; } minDate.setHours(minDate.getHours() + offset);
  9. 1 point
    vLeftButton, IconL, leftAction(), hmmm wonder why it does not work for right? A real puzzler this one.
  10. 1 point
    Only the content inside the loop is repeated. This is what the string looks like on each iteration of the loop: text = "<ul>"; "<ul>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li><li>Orange</li>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li><li>Orange</li><li>Apple</li>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li><li>Orange</li><li>Apple</li><li>Mango</li>" text += "</ul>"; "<ul><li>Banana</li><li>Orange</li><li>Apple</li><li>Mango</li></ul>" Since the string "<ul>" is not being appended inside the loop, it is not being repeated.
  11. 1 point
    I'll be rolling through the tutorials and have a specific question about a tutorial. It'd be cool if I could click a button that sends me here that sits next to every "try it". It looks like the "try it editors" have unique links. So right on this form, below title, submit the URL from the tutorial you have a question about. Eventually, there would be enough "tags" relating to the questions where the forum will just spit back previous questions about the tutorial when new users click from the tutorial "help" button.
  12. 1 point
    If you have a Content Management System (CMS), you will have to find or create a plug-in for the CMS that does that. If you don't have a CMS and there's no system for dynamically creating pages on your site then the sitemap will have to be created manually. Without knowing more about your website's back end I can't give a clear answer.
  13. 1 point
    You can add overflow to the w3-dropdown-content class and give it a max-height in order to cause the scrolling. On mobile devices, arranging the links into columns would likely get outside of the screen horizontally.
  14. 1 point
  15. 1 point
    This maybe unhelpful but it is one of the reasons why I make all my own icons. I don't want to have to rely on 3rd party code because it opens up vulnerabilities in your website.
  16. 1 point
    Thank you, Funci, for your very hard effort. Together we nailed the source of the problem. And, thank you, Ingolme, for providing the solution. Once again, I wish Ingolme, Funci, Dsonesuk, and everyone else at W3Schools a very Happy New Year! Roddy
  17. 1 point
    The $lang_type variable is only being created on specific conditions, if these conditions are not met then you will get a warning. You should initialize $lang_type with a default value outside of all of the if statements.
  18. 1 point
    Are you sure this isn't just your browser's auto-fill? Like this 'tooltip' only includes what you've previously written into similar fields?
  19. 1 point
    Always room for improvement and hopefully you'll never stop improving. Obviously you're learning so don't be afraid to break things. Experiment. Make mistakes. Decide for yourself what you think you've learned. Have the courage to be wrong. That's when I'm most likely to remember what I learned. The bigger the mistake the bigger the memory! EDIT: The most important question is what you posted good enough for you right now?
  20. 1 point
    Try wrapping this in an if statement that tests for string length: $var = 7; echo sprintf('%02d', $var);
  21. 1 point
    Images are inline by default. All inline elements are placed at the text baseline. There is always a bit of space reserved below the baseline, which is for hanging letters like "g" or "y", and you see this space below the image. In order to fix this, you can either make the image a block, or set its vertical align to "middle".
  22. 1 point
    <?php echo "What kind of issue are you having? Mind telling us more whats wrong with the code (expected results and what you are getting)"; ?>
  23. 1 point
    $display= overwrites the prev output, you need to append to prev output with $display.=
  24. 1 point
    These are not issues, they are just suggestions of things that the machine couldn't not verify are good. As long as a human can verify that this is accessible you can just ignore these warnings. The first message "Link text may not be meaningful." means that the text inside the link should be meaningful even out of context. This message is in place because some people put text like "click here" and "this website" which are meaningless without more context. If you think your link text is meaningful then you can ignore this message. The second message "Anchor text may not identify the link destination." is shown when none of the words of the link text are found in the URL of the link. The computer thinks that this might indicate that the link text does not describe the page that you are linking to, however if you know for sure that the link text describes the target page then you can just ignore this message as well.
  25. 1 point
    Localstorage will do that. First you set a default value if localstorage does not currently store any value related to chosen font size, else load localstorage value and make the chosen font-size active on page load or refresh. Then set onclick event to make selected fontsize active then at same set localstorage to store currently selected font-size also.
  26. 1 point
    HTML without CSS is practically useless in the modern web. If you don't know CSS in depth then you might as well not know HTML. CSS appears simple on the surface but it is actually more difficult to master than many people think. If you intend to be a full stack developer, it is usually a good idea to master the front end before moving on to the back end.
  27. 1 point
    No! It shouldn't make any difference. You either have a incorrect url to your external file, have not used required rel="stylesheet" for link element to stylesheet, have possible invalid css breaking the css following it. You did not clear history or cache before trying loading amended external css file. Note: the style tag is only required in html file NOT! External style sheet.
  28. 1 point
    .team-members { width: 25%; display: inline-block; padding: 3.8em; vertical-align: top; /* add this */ }
  29. 1 point
    The shortest equivalent code you can make without conditionals would look like this: $str_browser_language = ''; if(!empty($_GET['language'])) { $str_browser_language = $_GET['language']; } else if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $str_browser_language = strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ','); }
  30. 1 point
    You need to understand how the conditional works. In the statement X = C ? A : B , X is either equal to A or equal to B based on whether C is true or not. In other words: if(C) X=A else X=B
  31. 1 point
    It means that you can use "$0" as a variable in the console to reference the currently selected element.
  32. 1 point
    Hello & Thanks; Here is a ' mini-Tutorial: moving text to & from <textarea> & <pre> ' http://vmars.us/ShowMe/Tutorial-Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore-RO-VM.html I'll also put code here for safekeeping : <!DOCTYPE html> <html> <head> <!-- https://www.freeformatter.com/html-validator.html http://vmars.us/ShowMe/Tutorial-Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore-RO-VM.html --> <title id="titleId"></title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="UTF-8"> <style> </style> </head> <body onload="documentURL() , onloadRestoreTextarea()" > <br> <button onclick="saveAs(filename, allHtml)">Save This Page</button> <br><br> <div id="inlineDiv" style="display: inline-block;"> <div style="border-style: solid; align-text: center; border-width: 1px; display: inline-block;"> <button onclick="sendToConcoleLog ()">sendToConcoleLog</button> <br><br> <textarea id="toConsoleLogId" rows="4" cols="12">:</textarea> </div> <div style="border-style: solid; align-text: center; border-width: 1px; display: inline-block;"> <button onclick="saveItAll()">Copy this into PRE</button> <br> <textarea class="copyFrom" rows="4" cols="12"></textarea> </div> <div style="border-style: solid; align-text: center; border-width: 1px; display: inline-block;"> <button onclick="restoreItAll()">Restore this from Pre</button> <br> <pre contenteditable="true" class="pasteInto" ></pre> </div> </div> <!-- id="inlineBlock"> --> <div style="border-style: dotted; align-text: center; border-width: 1px;"> <pre> Thought I would make a turorial so I remember what I learned from you all , and to pass on your wisdom. Hope this helps someone :) Try this: ------------------------------------------------------------------------------------------------------------------------ 1) Type something into "Copy this into Pre" textarea box . Then click "Copy this into Pre" Button . Text is copied into "Restore this from Pre" "pre area ' . And "Copy this into Pre" textarea box , is Cleared . Study This : function saveItAll() ------------------------------------------------------------------------------------------------------------------------ 2) The click on "Restore this from Pre" Button , Text is copied from "Restore this from Pre" area into "Copy this into Pre" area . And "Restore this from Pre" area , is Cleared . Study This: function restoreItAll() ------------------------------------------------------------------------------------------------------------------------ 3) Now Type something into "Copy this into Pre" textarea box Again . Then click "Copy this into Pre" Button . Text is copied into "Restore this from Pre" pre area . And "Copy this into Pre" textarea box , is Cleared . But this time , click the "Save This Page" Button . Study This: function saveAs(filename, allHtml) This .html page will be saved in your Browser's download area . Since the "Restore this from Pre" pre area , is coded as contenteditable="true" , the downloaded page will save the "pre area" text as innerHTML . A nifty feature of 'contenteditable' is that upon opening the saved-page the content of "pre area" is now " hardCoded " into page . Study This: function onloadRestoreTextarea() ------------------------------------------------------------------------------------------------------------------------ See code : So in the ' body ' tag we have : "onloadRestoreTextarea()" which runs the " function onloadRestoreTextarea() " code , when page is loaded . Which copies text from "pre area" to " textarea" box . Also at ' body onload="documentURL() ' page load time: The function: function documentURL() is run , which copies ' this .html ' file's address into the ' title ' tag . BTW: for example (see code) and note that : IF you want to copy what’s typed in the box use .value . console.log(toConsoleLogId.value); IF you want what was hardcoded into the text box’s HTML , use .innerHTML . console.log(toConsoleLogId.innerHTML); Hope this helps someone.... http://vmars.us/ShowMe/Tutorial-Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore-RO-VM.html </pre> </div> <script> var copyFromVar = "one"; function saveItAll() { var blankVar = ""; var fromList; // = document.getElementsByClassName("copyFrom"); var intoList; // = document.getElementsByClassName("pasteInto"); fromList = document.getElementsByClassName("copyFrom"); intoList = document.getElementsByClassName("pasteInto"); for (var i = 0; i < fromList.length; i++) { copyFromVar = fromList[i].value ; intoList[i].innerHTML = copyFromVar; fromList[i].innerHTML = blankVar; fromList[i].value = blankVar; } }// </script> <script> var copyFromVarTwo = "two"; function restoreItAll() { var blankVar = ""; var fromListTwo; // = document.getElementsByClassName("copyFrom"); var intoListTwo; // = document.getElementsByClassName("pasteInto"); intoListTwo = document.getElementsByClassName("copyFrom"); fromListTwo = document.getElementsByClassName("pasteInto"); for (var i = 0; i < fromListTwo.length; i++) { copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; fromListTwo[i].innerHTML = blankVar; fromListTwo[i].value = blankVar; } } </script> <script> var copyFromVarOnload = "three"; function onloadRestoreTextarea() { var fromListTwo; // = document.getElementsByClassName("copyFrom"); var intoListTwo; // = document.getElementsByClassName("pasteInto"); var blankVar = ""; intoListTwo = document.getElementsByClassName("copyFrom"); fromListTwo = document.getElementsByClassName("pasteInto"); for (var i = 0; i < fromListTwo.length; i++) { copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; fromListTwo[i].innerHTML = blankVar; fromListTwo[i].value = blankVar; } } // reloadTextarea </script> <script> function sendToConcoleLog() { var var01 = toConsoleLogId.value; console.log(var01); // alert(var01); var var01 = toConsoleLogId.innerHTML; console.log("If nothing after : Then no nothing was typed into this textarea => " + var01); alert("If nothing after : Then no nothing was typed into this textarea => " + var01); console.log(toConsoleLogId.value); console.log(toConsoleLogId.innerHTML); /* should be console.log(toConsoleLogId.value); if you want what’s typed in the box, or console.log(toConsoleLogId.innerHTML); if you want what was hardcoded into the text box’s HTML. */ } </script> <script> var filename = ""; function documentURL() { document_URL = document.URL; document.getElementById("titleId").innerHTML = document_URL; } </script> <script> var filename = "Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore.html"; var allHtml = document.documentElement.outerHTML; function saveAs(filename, allHtml) { allHtml = document.documentElement.outerHTML; var blob = new Blob([allHtml], {type: 'text/csv'}); if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else{ var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } </script> </body> </html>
  33. 1 point
    You'll draw using a canvas: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial There's a discussion about animation in general here: https://javascript.info/js-animation
  34. 1 point
    Thank you Funce ! I will study this until I understand every 'jot and tittle' . You moved me to start a Folder for w3schools-Examples . http://vmars.us/w3schools-Examples/Draggable-Div-Elements-w3Schools-FUNCE.html Thanks again
  35. 1 point
    mysqli_stmt::bind_param binds each variable to a matching parameter. You cannot match all of them to one. It doesn't work like that. (Neither can you attempt to use a string like an array) What you can do however, is bind an array using variable length argument lists. Use ... to indicate an argument list as below. <?php $vals = [101, "ASUS H61M-E", "abcde", 2, 1, 5300.00, 6500.00, 11, 5300, 55528, 101]; $uq = $mysqli->prepare("UPDATE $tbl SET $cols WHERE $whcol='$whval'"); if (!$uq) { $msg = "Error1: $mysqli->error!"; } else { $uq->bind_param('issiiddiiii', ...$vals);
  36. 1 point
    If you use include_once or require_once to include files in PHP then it will only include the same file once even if there are multiple include statements. Hopefully you have a main PHP include file that your other PHP files include that defines various global functions and variables, and that would be the place to include any file that you want available on any other page.
  37. 1 point
    It sounds like you think your code is the same as this: var jsonLikeObj = { getFoo: { value: function() { return this.foo = 1; }, enumerable: false } }; It's not, that's not what Object.create does. That second parameter is a description about how to create the object, it's not the actual object. jsonLikeObj.getFoo.enumerable is also undefined. Why? Because that's not the actual object, it's the specification for the object. It's metadata. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
  38. 1 point
    Iframes pose their own problems, one of the biggest ones being that the pages in the iframe don't have their URL shown in the address bar, which means that people (and search engines) cannot link back to them.
  39. 1 point
    What is wrong? You expected center center not to work in media query? You'd be wrong, it would carry on from position styling from default non media query styling, as does background size, attachment and repeat. If you want to reset to default value use background-position: initial; in media query.
  40. 1 point
    Potato and knife? Banana and fork? Apple and spoon? Or maybe chalk and cheese. 😁
  41. 1 point
    I'm not sure what else it would be, there might be another animation playing still. It seems like there are competing animations. The fact that it doesn't do it if you wait (presumably until after any animations finish) suggests that's the issue.
  42. 1 point
    You will have to start learning a server-side programming language such as PHP. It is not easy, be patient and take your time to learn it properly before applying it to projects.
  43. 1 point
    In Javascript, all strings are internally treated as UTF-16 strings: http://ecma-international.org/ecma-262/5.1/#sec-8.4 http://speakingjs.com/es5/ch24.html
  44. 1 point
    For that example, the easiest way would be to use different class names for your other slideshow. So use mySlides2 and dots2, for example, and make a copy of that Javascript code with a different function to run the second slideshow with the other class names.
  45. 1 point
    Here's a version if you're not into the whole brevity thing: function getUnique(inputArr, comp) { const unique = inputArr.map(function (e) { // return an array of only one property from the original array of objects (if defined) console.log(e[comp]); return e[comp]; }).map(function (e, i, final) { console.log("final", final); console.log("e", e); console.log("i", i); // return an array of either false values or indexes // this will result in an array where each value is listed only once, in the first position it appears, // and any other appearances will be false // the array will be the same length return final.indexOf(e) === i && i; }).filter(function (e) { console.log("e", e); console.log(inputArr[e]); // this will create an array of objects from the original array in each index from the previously mapped temp array // this will exclude the duplicates because those indexes in the previous array are set to false return inputArr[e]; }).map(function (e) { console.log("e", e); console.log(inputArr[e]); // this will reindex the array to remove "holes" return inputArr[e]; }); console.log(unique); return unique; } var ar = [ { 'prop': 1 }, { 'prop': 2 }, { 'prop': 1 }, { 'prop': 3 }, { 'prop': 1 }, { 'prop': 4 }, { 'prop2': 1 }, { 'prop3': 1 } ]; getUnique(ar, 'prop'); What's the purpose? This function takes an array of objects, and will return an array of those objects that have unique values for a particular property. How do multiple values fit into that? Do you have an example?
  46. 1 point
    You're not saving the return value of toFixed.
  47. 1 point
    https://www.php.net/manual/en/function.debug-backtrace.php
  48. 1 point
    Hi. I use some code from w3schools for my business website https://manlyelectronics.com.au/. I am looking forward to improving both.
  49. 1 point
    It's just the initial value. If you don't start off with an initial value then you make a new object every time and return it.
  50. 1 point
    LOL :)At that age, you're untouchable...
×
×
  • Create New...