Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>PHP runs on the server, the user giving the confirmation is on the client. That means you have to use javascript/Jquery to trigger an event when the user gives his confirmation, then call a php that does the UPDATES or other query. This can be done with a AJAX call, or just submiting a form or with a url redirection.</p> <p>So it should be like this:</p> <ol> <li>First <code>A.php</code> that gets the form submited with the user data, does some queries and displays the confirmation text. This also has javascript code to submit the confirmation to another <code>B.php</code>, normally this would be done with a AJAX call that will receive something in return.</li> <li>Second <code>B.php</code> that receives the confirmation of the first <code>A.php</code>, does the UPDATES and returns something to tell the first <code>A.php</code> all the query went OK. If something goes wrong it could return a error code, or a error message detailing the error.</li> <li><code>A.php</code> shows the return of <code>B.php</code> to the user.</li> </ol> <p>UPDATED CODE:</p> <pre><code>$.post("updatedatetime.php", $("#updateForm").serialize() ,function(data){ alert(data); }); </code></pre> <p>The <code>function(data)</code> at the end is a callback function, that means that it will be executed once <code>updatedatetime.php</code> ends its execution. The variable <code>data</code> it receives is the return of <code>updatedatetime.php</code> (what you echo in that php) </p> <p>To check if your AJAX is executing properly, if the variables have values, the return, etc. I would recommend to use Firebug, in its console it will display all this info. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload