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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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