Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 09/14/2019 in Posts

  1. 1 point
    Browser cache, or if you use save login details in the browser itself usually setting->Privacy->Manage Logins. You can clear all these by making sure you select saved logins option (maybe under advanced) when clearing history.
  2. 1 point
    If you need another condition, use else if(), if not then just use else. Neither of them are required, you just use them if you need them.
  3. 1 point
    filter_var() with the FILTER_VALIDATE_INT filter returns an integer, not true, so === true will always fail. By using The ! operator, they transform it into a boolean. This boolean, for any integer other than zero, is always false. This solution doesn't account for the integer zero which converts to true, but W3Schools also has a section talking about that. They could just use !!filter_var() or (bool)filter_var() and they wouldn't need the === false part. This would still not solve the integer zero problem, though.
  4. 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']), ','); }
  5. 1 point
    No, they don't produce the same result because in your code you're skipping over some comparisons that have to be made. Regardless of whether $_SERVER['HTTP_ACCEPT_LANGUAGE'] was tested or not, you have to test $_GET['language'] in order for the statements to be equivalent.
  6. 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
  7. 1 point
    No, that is incorrect. Each line is its own set of conditions completely independent from the other line of code. It is equivalent to the following code: if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $str_browser_language = strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ','); } else { $str_browser_language = ''; } if(!empty($_GET['language'])) { $str_browser_language = $_GET['language']; } else { $str_browser_language = $str_browser_language; }
  8. 1 point
    Attention: Funce: This post is to acknowledge that you were correct with regard to the necessity of editing the hosts file, in order for the nginx-1.17.3 web server to serve up my web pages. It was necessary to create "www.mydomain.com; mydomain.com" pairs associated with my dynamically allocated ( i.e., using Dynamic Host Configuration Protocol ( DHCP )) Internet Protocol ( IP ) address, for each web page. Last Friday, I was able to successfully configure the web server ( i.e., the "nginx.conf" file ), and all of my web pages are served up ( you can visit "theholybible1.ddnsfree.com" ) if you like. Thank you ( see Colossians 3:15, for example ) for your help. Keep in touch. 🙂 Sincerely in Christ, Russell E. Willis P.S. - Please read Proverbs 23:23.
  9. 1 point
    Its always done that! Any floated element placed within a container element has no substance, so the container will collapse to height 0. Using property overflow reverses that condition for the container element.
  10. 1 point
    Ah , at last , it works: Ok Funce , I finally see what you meant . Thanks All . <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>FreshDraft.StrippedDown></title> <style> @media print { .pageBreak{ page-break-after: always; } } </style> </head> <body id="bodyId" > <div> <br> <textarea class="copyFrom" spellcheck="false" rows="4" cols="12">textarea 1 line 1 textarea 1 line 2 </textarea> <br> <textarea class="copyFrom" spellcheck="false" rows="4" cols="12">textarea 2 line 1 textarea 2 line 2 </textarea> <br> <pre class="pageBreak">.</pre> <pre class="pageBreak">.</pre> </div> <br> <div> <br> <button id="printThisBtn" onclick="printAllThis()" style="display: block">Print This</button> </div> <script> var copyFrom = document.getElementsByClassName("copyFrom"); var pageBreak = document.getElementsByClassName("pageBreak"); var printThisBtn = document.querySelector("#printThisBtn"); function printAllThis() { collectedTextareas = ""; for (var i = 0; i < copyFrom.length; i++) { pageBreak[i].innerHTML = copyFrom[i].value ; } for (var i = 0; i < copyFrom.length; i++) { copyFrom[i].style.display = "none"; } printThisBtn.style.display = "none"; window.print(); console.log("window.printing"); for (var i = 0; i < copyFrom.length; i++) { copyFrom[i].style.display = "block"; } printThisBtn.style.display = "block"; } </script> </body></html>
  11. 1 point
  12. 1 point
    I wouldn't count on the filesystem returning data the way you want, I would get the list of all of the files and folders, sort them however you want to sort them, and print the sorted list.
  13. 1 point
    You've gotta modify this regex so you're using the entire string that matches as follows. (?=(.*\d){2})(?=.*[A-Z])(?=.*[a-z]).* Does this work for this one? And for this one, I've done a negative lookahead, that if it matches more than 3 digits, it won't be valid. ^(?=(.*\d){2})(?=.*[A-Z])(?=.*[a-z])(?!(.*\d){3,}).*$ Does this work for this one? Ab45 -> Match a4F8 -> Match aosjgHJ35 -> Match JsOsm4Osmf6 -> Match JsO2m4Os4f6 -> No match (3 numbers)
  14. 1 point
    It means that you can use "$0" as a variable in the console to reference the currently selected element.
×
×
  • Create New...