Re: Redirection Question.
| From: | Nicole Amashta | Date: | Wed, 23 Jan 2002 16:13:47 +0000 |
| Subject: | Re: Redirection Question. | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11588@lists.php.net to get a copy of this message | ||
you could try this instead of the header redirect. I use this and it works
fine for me.
$url = "the_url_to_the_script";
echo "<script>window.location='$url';</script>";
I usually wrap that in a method and call it "goTo()"
function goTo($url)
{
echo "<script>window.location='$url';</script>";
}
So, my code looks like this:
$url = "the_url_to_the_script";
goTo($url);
good luck,
Nicole Amashta
Web App. Dev.
www.aeontrek.com
"Curtis" <Curtis@scdservices.zzn.com> wrote in message
news:84C06A0DC2AF9374D910E64C74D1C4D0@Curtis.scdservices.zzn.com...
> I've got everything working except for one piece.
>
> I'm trying to authenticat users against a mySQL database and then
> once they are authenticated I'm trying to create a session that's the
> same as their username. Once the session is established I want to
> redirect them to another page that requires the session to be
> established. However I get everything except for the redirection to
> work.
>
> At this point I have already authenticated them by finding a row in
> the database with the username and password they entered through a
> form. Now I want to establish a session with their authenticated
> username.
>
> Here is where the code is failing.
>
> if ($myrow = mysql_fetch_array($result)) {
> file://if there is a row in the database then the user
> file://must have submitted the username and matching password
>
> session_start();
> session_register($username);
> header ("Location: ./myinfo.php"); file://THIS IS NOT WORKING!!!!!
> file://exit;
> /* I tried with and without the exit.
> If I do without the exit nothing happens
> and the below is not shown on the screen.
> When I try it with the exit the below is
> shown and I'm still not redirected.
> */
> file://echo "<b><i>We have located you in the
> database!</b><p>";
> }
> else
> {echo "<b><i>No Records Found!</b><p>";}
> file://Show login again
>
>
>
> Any tips, ideas, or suggestions would be greatly appreciated.
>
> Thanks,
> Curt
>
>
> www.killerpigs.com
> www.scdservices.com
> www.angryland.com
> Get your Free E-mail at http://scdservices.com
> ____________________________________________________________
> Get your own FREE Web and POP E-mail Service in 14 languages at
http://www.zzn.com.