Jump to content

Funce

Moderator
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Funce

  1. This exercise doesn't seem to be functioning robustly. Any whitespace will cause the question to be rejected as a failure. This includes new line characters after the code, additional spaces between commands, or otherwise. The best you can do, is to find the associated tutorial and press Report Error at the bottom of the page.
  2. You need to make sure you're using an absolute path when referring to the target directory. PHP has no concept of relative paths Nevermind this part You can generally access the web root by using <?php $_SERVER['DOCUMENT_ROOT'] Alternatively, you can use <?php __DIR__ This will create an absolute path of the current directory of the running file. So this one may more easily fit into your current code. Give it a try.
  3. I can stick around for a while Roddy. Just grabbed lunch(Oh New Zealand time) so I'm quite clear for the next few hours.
  4. Regardless of what PHP does, all the JavaScript receives is a string(in this case) so processing still happens. But... I just had a thought. the jQuery ajax success method takes an "intelligent guess" on what data is being received and parses accordingly. (I just looked it up because I wasn't sure) It could be that you're attempting to JSON.parse a JSON object.... Try taking it out and seeing what happens. Or you can console.log it and see if its an object or a string to be parsed.
  5. Because you're parsing the JSON data from the server, if JSON.parse is failing it means that the PHP file may be incorrectly outputting the JSON. This may come about as a PHP error(ending execution before output) or maybe its just malformed. Check your Network tab of your webconsole, and see if you can find the call to the Captcha file. You'll be able to see what the server responded with.
  6. Oh! I see. Can you instead look for 200 vs 500 response code behaviour, and try it again?
  7. Might be a good step. But you've just replaced all the lines, and the error hasn't come back? Or did it come back at an earlier step?
  8. Now return the lines removed, one at a time, until it errors.
  9. I was referring to specifically these three lines. If the page errors with just these lines (and your error logging) then the error resides inside these pages. <?php require_once '.../vendor/autoload.php'; require_once '.../select_color_pair.incl.php'; require_once('.../class.imageless_captcha.php');
  10. Good, good. I want to see if any of those included files are silently erroring Can you create a separate page that just includes them on their own, and see if that creates a 500 error?
  11. If it wasn't, I would be very concerned about how you're naming your defines.
  12. Happy New Year to you too, Roddy. And the log otherwise works with an introduced error?
  13. So I tried a couple of requests to the page mentioned and you've definitely isolated the problem code here. (Only a POST request with that payload errors) I'd want to check if that logging system is working first. Try introducing a syntax error and see if that comes up in the logs. If it does, good! We know that works. We may be looking at something that is suppressing third-party code errors. (Maybe the '@' operator) If it does not, you'll need to check your logging settings, make sure they're going to the correct location on your webhost.
  14. I get zero delay with what you've provided (when I've corrected the errors) Is this test data somewhat accurate? <!DOCTYPE html> <html> <body> <form name="DateSetting" action="" method="post" onsubmit="return formcheck(DateSetting)"> YY <input style="text-align:center;width:30" name="yy" id="yy" required maxlength="2" /> &#160;MM <input style="text-align:center;width:30" name="mm" id="mm" required maxlength="2" /> &#160;DD <input style="text-align:center;width:30" name="dd" id="dd" required maxlength="2" /> <button type="submit" name="sub" id="sub">Submit</button> </form> </body> <script> function formcheck(myform) { with (myform) if (yy.value.length != 2) { alert("Year must be 2 digits."); yy.select(); return false; } if (mm.value.length != 2) { alert("Month must be 2 digits."); mm.select(); return false; } if (dd.value.length != 2) { alert("Day must be 2 digits."); dd.select(); return false; } if (dd.value < "01" || dd.value > "31") { alert("Invalid Day."); dd.select(); return false; } if (mm.value < "01" || mm.value > "12") { alert("Invalid Month."); mm.select(); return false; } if (yy.value < "01" || yy.value > "99") { alert("Invalid Year."); yy.select(); return false; } if ( ((mm.value == "04" || mm.value == "06" || mm.value == "09" || mm.value == "11") && dd.value > "30") || (mm.value == "02" && dd.value > "29") ) { alert("Invalid Day for Month or visa versa."); dd.select(); return false; } alert("Finished"); sub.focus; return true; } </script> </html>
  15. This would really depend on if you want your site up and going as fast as possible, or you're wanting to experiment with something new. I recently joined on to a dev team that served their whole website with static files, it was a nightmare to maintain, so it's good you can see that hurdle. If you've got a good grasp on HTML, CSS and JS you may want to get the jump on a server-side language. PHP may be a good pick for at making your website a little more easy to maintain. I can imagine that the header and footer of your website is the same in each page? You'll be able to use the include command to bring it into your page at will. When you update the "header.php" file, it'll update in all the pages that link to it. That's the first thing I did, and its made updating the site a real breeze. If you feel up to it, you may also try using a framework like Laravel, or Symfony. However, they're more complex and not covered on the w3schools PHP module.
  16. From what I've read, as long as the link it goes to is in the same file (either in-line or down the page) and is relatively simple to resolve. Google'll take it. The info was back from 2012, so maybe its been improved since then.
  17. Funce

    Baffling CSS

    I concur with dsonesuk, it's probably some form of caching issue. Make sure you hard-refresh (CTRL + F5 on Windows) each time you update your CSS. However, your first picture perfectly (I think) matches your given CSS file. (Below) p.five { max-width: 80%; height: 80px; margin-top: 30px; margin-left: auto; margin-right: auto; margin-bottom: 0px; border-style: solid; border-width: 2px; border-color: blue; text-align: center; background-color: Lavender; } And other than what dsonesuk has pointed out about the use of tags, there really isn't anything too outlandish going on.
  18. 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. n is a parameter passed when the showSlides function is called. It evaluates to whatever is put inside the function call, for instance: showSlides(3); Would give the value of n to be three. Take a look at the JavaScript Functions Reference for more information.
  20. Well, you've come to the right place! Try the HTML tutorial for a nice and quick way to get the basic layout up and running https://www.w3schools.com/html/default.asp If you have any trouble regarding something specific you can make a new post.
  21. Funce

    Baffling CSS

    You should be able to open your developer tools on your browser to find out what and where styles are being applied. In most browsers you can Right Click > Inspect Element or some other permutation of that to see it. Otherwise, you may have more luck pasting the PHP here in a code block for us to look at.
  22. There isn't very many specifics here. I wouldn't be able to advise exactly. The possibility of this will depend on how well documented the supplier api you wish to use.
  23. Yes indeed, checkboxes only send data when checked. Glad I could help.
  24. Name attributes on your inputs. That's the only way the data can be retrieved in the FormData. I can see one textarea has one 'title1' which is why you can probably see that one.
×
×
  • Create New...