We used the following on the "Thank you" form page to redirect back to the form in 5 seconds and carefully pre-populate the name fields with the values:
<script> setTimeout(function() {location.href = '<?php echo $var3['returnurl'] ?>?fullName[first]=<?php echo $var1['first'] ?>&fullName[last]=<?php echo $var2['last'] ?>'}, 5000); </script>
Works fine until the returnurl field is https: // url. He then stays on the thankyou page in a loop, trying to do a redirect. There are no iframes involved .... tried top.location.href ... not good ... even tried location.replace
Can anyone see any restrictions with code that could affect the redirect to https: // url.
Code in php file ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no"> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="width"> <title>Thankyou</title> <style type="text/css"> body { margin: 0px; padding: 0px; background: #fff; font-family: Arial; } #message { position: absolute; left: 50%; width: 320px; margin-left: -160px; } </style> <?php $answers = $_POST; $var1 = array("first" => $answers[fullname][0]); $var2 = array("last" => $answers[fullname][1]); $var3 = array("returnurl" => $answers[returnurl]); ?> </head> <body> <script> setTimeout(function() {location.href = '<?php echo $var3['returnurl'] ?>?fullName[first]=<?php echo $var1['first'] ?>&fullName[last]=<?php echo $var2['last'] ?>'}, 5000); // this duration is in millisecs </script> <div id="message"> <p> </p> <div style="text-align: center;"><h1>Thank You!</h1></div> <div style="text-align: center;">Your submission has been received.</div> <div style="text-align: center;">We're most grateful</div> <div style="text-align: center;"> </div> <div style="text-align: center;"><img src="http://www.mazeguy.net/bigsmilies/thumbsup.gif"></img></div> <div style="text-align: center;"> </div> <div style="text-align: center;">You will return in 5 seconds</div><br /> </body> </html>
Here is the result of the submission ... the source of the "Thank you" page shows ... yes, the secure URL of the page does not pass ...
<script> setTimeout(function() {location.href = '?fullName[first]=&fullName[last]='}, 5000); </script>
source share