Page 1 of 1

If redirected from page **** then echo "message"

Posted: Sun Feb 15, 2009 6:09 pm
by mikes1471
Hi Everyone

I have created a registration and a login script now and have the registration page redirect to the login page after registration has been completed.

What I want is - if the user has been redirected from registration.php then echo "Welcome, you have successfully registered"

What do I write to influence this?

Mike

Re: If redirected from page **** then echo "message"

Posted: Sun Feb 15, 2009 6:31 pm
by braveryonions
You could check to see if a $_POST or $_GET variable is set, and choose to display the message from that.

Re: If redirected from page **** then echo "message"

Posted: Sun Feb 15, 2009 7:25 pm
by jackpf
The way I would do it is

Code: Select all

 
<?php
    //note that $_SERVER[HTTP_REFERER] also includes any variables in the url, eg ?id=34
    if($_SERVER[HTTP_REFERER] == 'register.php')
    {
        echo 'Welcome, you have successfully registered...';
    }
?>