Page 1 of 1

Registration page redirect

Posted: Sun Mar 01, 2009 11:59 am
by mikes1471
Hi Everyone

I have my registration script which works fine and clears the form from the webpage and displays the paragraph "Hello (username) you have successfully registered... etc"

My problem is, if I assign a hyperlink to this message saying "click here to sign in" for example the registration page produces an error, so I thought perhaps I could display the welcome message for 5 seconds and then redirect to the login page, does anyone know how I can do this?

Any help would be much appreciated

Mike

Re: Registration page redirect

Posted: Sun Mar 01, 2009 3:04 pm
by php_east
without seeing your registration method, i would assume you use a form with values for username/password etc, and the link does not pass these values to your login so it generates an error.

this redirection can be done by if you mimic the form values in your welcome message itself, declaring them as hidden so that the user does not see them. the presense of the values will then suppress the errors, and if they are blank, i believe your login page will prompt the user to enter them. if not, you have to modify your login to accept blanks and prompt for input.

again, this is all said without looking at the actual login mechanism. but the principle is that, yes.

Re: Registration page redirect

Posted: Sun Mar 01, 2009 3:43 pm
by watson516
If you're getting a 404 error when you try to use the link method then you probably just need to fix the link. As for the timed redirect, use javascript.

Code: Select all

<script type="text/JavaScript">
<!--
setTimeout("location.href = 'http://www.google.ca';",1500);
-->
</script>

Re: Registration page redirect

Posted: Sun Mar 01, 2009 9:44 pm
by semlar
watson516 wrote:As for the timed redirect, use javascript.
No, please. No.

Code: Select all

header('refresh: 5; url=/login.php');