Jump to content

[SOLVED] thanks, then redirect


Ninjakreborn

Recommended Posts

I have seen

Thank you for submitting the form ... Redirecting

Or

Thank you for submitting the form ...

Redirecting in 5 (4, 3, 2, 1, 0, redirect)

So..., how do I do that.

I know how to redirect, it's just I don't know how to do it like that.  I have noticed lately, that when I do a form you are able to submit over, and over, and over again, which causes problems, and I finally found a client who pointed that out.  I do that all the time, I need a way to do it, to where when the form actually submits, something happens to prevent it from submitting again.

So the redirect idea came to mind, how do I get that to work, and what other options do I have to prevent the continual re-submittal of the information.

Link to comment
https://forums.phpfreaks.com/topic/46713-solved-thanks-then-redirect/
Share on other sites

http://www.tizag.com/javascriptT/javascriptredirect.php

 

Ok, I have the Java script Bible, which has a lot.  is there an on line directory of in-build Java Script functions, that explain the different one's, because I wasn't even aware that the setTimeout() function existed.

Again, this post has veered into Java Script, instead of PHP.  I originally was thinking some way with output buffering to delay the location header or something, thanks for the feedback.

Yes, I came up with something and it works perfectly.

I created

<script type="text/javascript">
<!--
function delayer(){
    window.location = "cymember.php";
}
//-->
</script>

I also can modify that, to put an argument there for the url if I need to change that around.

From there I use

							echo "Updated Successfully.<br />";
							echo "Redirecting....";
							?>
							<script type="text/javascript">
							setTimeout('delayer()', 3500)
							</script>

and so far it seems to be working flawlessly.  Thanks for all the feedback, if he ends up liking the way this works, I think I will use this in my future projects as well.  More user friendly that way anyway.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.