Note that there are some explanatory texts on larger screens.

plurals
  1. POPost form, wait ten seconds and redirect to
    primarykey
    data
    text
    <p>I have a page that need to do the following steps:</p> <p>Step 1 - Receive URL address, name, value, num and ID via <code>POST</code></p> <p>Step 2 - Wait 10 seconds </p> <p>Step 3 - Send (also via post) the following info received via post: name, value, num and ID to the URL received via post</p> <p>Step 4 - Redirect to the URL that received the post and print the post in the screen.</p> <p>For this I'm using the code below, but anything is going wrong, because the print in the redirected URL, that should bring the post info is coming empty, so it looks like that for any reason the info is not being posted correctly.</p> <p>Could someone please tell me what I'm doing wrong? </p> <p>Code:</p> <p>HTML - Create the Form to POST:</p> <pre><code>&lt;form id="ret" name="return_url" method="post" action="&lt;?php print_r($_POST['url']);?&gt;"&gt; &lt;input type="hidden" name="name" value="&lt;?php print_r($_POST['name']);?&gt;" /&gt; &lt;input type="hidden" name="value" value="&lt;?php print_r($_POST['value']);?&gt;" /&gt; &lt;input type="hidden" name="num" value="&lt;?php print_r ($_POST['num']);?&gt;" /&gt; &lt;input type="hidden" name="ID" value="&lt;?php print_r($_POST['ID']);?&gt;" /&gt; &lt;input type="hidden" name="status" value="OK" /&gt; &lt;/form&gt; </code></pre> <p>Add the posted url content to the var <code>$retorno</code> that will be used in Javascript (PHP):</p> <pre><code>&lt;?php $retorno = $_POST['url']; ?&gt; </code></pre> <p>Start the counter, submit the form and redirect (using javascript):</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; window.onload = function() { function countdown() { if (typeof countdown.counter == 'undefined') { countdown.counter = 10; // initial count } if (countdown.counter &gt; 0) { document.getElementById('count').innerHTML = countdown.counter--; setTimeout(countdown, 1000); } else { document.getElementById("ret").submit(); location.href = '&lt;?php echo $retorno?&gt;'; } } countdown(); }; &lt;/script&gt; </code></pre>
    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.
    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