I have create a table as "user" with colm user pass redirect
and add the three user as:

user : Pass : Redirect
a123 123 google.com
b123 123 hotmail.com
c123 123 facebook.com
i have also create a php page with login session but i want that when i entered the NO 1 detail then it goes to the google.com. and when i enter the no 2 detail it shuld go on hotmail.com.

in my php page it only goes to the redirect page as "" plz help me in this regard.

6 Years
Discussion Span
Last Post by dietdew12z

It would be better if you could post code, but I've dealt with this and will see if my solution works for you.

Using javascript you can redirect using location.replace(URL) or location=URL, location.replace will not create an entry in the browser history, the other will. So here's an off the top of my head function in PHP.
This one will *not* allow you to click back to get to the page you just left.

function gotopage($where)
 echo "<script type='text/javascript'>location.replace($where)</script>";

This one should allow you to click back to get to the previous page

function gotopage($where)
 echo "<script type='text/javascript'>location='$where'</script>";

Now, I say 'should' because I've had times that this didn't work and I'm not sure why, also you'll note that even though the variable $where is in single quotes it will still resolve to the variable contents because the whole thing is inside double quotes.

Hope I did that helps,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.