Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2020 in all areas

  1. Yes. Session start must be called on each page on which you want to share data.
    1 point
  2. var jsonObj = request.result; This sets jsonObj to undefined because XMLHttpRequest doesn't have a result property. You need to read and parse the responseText property. XMLHttpRequest is an older standard. You might also want to look at the more modern fetch() API instead.
    1 point
  3. Just to make sure, for benanamen's suggestion, you should replace the following line: if(isset($_POST["submit"])) With the line below. Note that I removed the curly / smart quotes around POST. if($_SERVER['REQUEST_METHOD'] == 'POST') I would also add some sort of debug code to see if the if test is working. For example, if($_SERVER['REQUEST_METHOD'] == 'POST') { echo '<br>form submission detected'; Does the script display "form submission detected" after submitting the form? Also, if the script still doesn't work as you expect, please post your most recent code.
    1 point
  4. You have made a classic mistake of depending on the name of a button to be submitted for your code to work instead of checking the POST Request Method. Since you didn't name your submit button, the code does not do anything. The fix is NOT to add a name to the button, but to instead check the REQUEST METHOD instead. Depending on the name of a button to be submitted will completely fail in certain cases. if($_SERVER['REQUEST_METHOD'] == ‘POST’){ // Do stuff } Your error checks will also fail. You need to trim the entire POST array and then check for empty. Do not create variables for nothing. Your code is also vulnerable to an XSS Attack. You are allowing user supplied data directly in your form.
    1 point
  5. I see the session start but I don't see where you set any $_SESSION variables. Where is the code that outputs the error you say is not showing up?
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.