Re: Redirection Question.

From: Date: Sun, 20 Jan 2002 16:48:45 +0000
Subject: Re: Redirection Question.
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-11527@lists.php.net to get a copy of this message
> A lot of people have trouble with sending the Location header. A more > effective means is sending this: > > header("Refresh: 1;url=/path/to/myinfo.php"); > > I believe that's right. I haven't done it in awhile... > Like the HTML header, you can even turn 1 into 0 and get redirected straight away. > > > >Here is where the code is failing. > > > >if ($myrow = mysql_fetch_array($result)) { > >//if there is a row in the database then the user > >//must have submitted the username and matching password > > > >session_start(); > >session_register($username); > >header ("Location: ./myinfo.php"); //THIS IS NOT WORKING!!!!! The usual problem is that headers have already been sent, i.e. if there's even a single blank before your "<?php" tag. If that were the case, you'd get the message 'headers already sent ' or something. I'm not too sure about the './' part, either: I always go straight for the filename if it's in the same directory, and it's never failed me yet. That's all the help I can give, I'm afraid... Symeon Charalabides (cosmopolitan trainee) ------------------------------------------ http://www.webmate.gr

« previous php.windows (#11527) next »