Jump to content


Photo

browser redirect


  • Please log in to reply
1 reply to this topic

#1 highaspen

highaspen
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 01 March 2006 - 11:09 PM

I'm trying to redirect the browser by inputing a dynamic URL from a database. Here is the code after the database login procedure.

__________________

$rs=mysql_query($sql,$conn)
or die("Could not execute query");

$list ="<html>";

while($row= mysql_fetch_array($rs) )
{
$list.="<meta HTTP-EQUIV=Refresh CONTENT='1;URL=".$row["productlink"]."></html>";
}

echo($list);

?>
_____________________

What happens is the browser looks like it's in an endless loop. I'm guess there is a better way to do this. ANy ideas?

Thanks in advance.

#2 php_b34st

php_b34st
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 01 March 2006 - 11:13 PM

Try:

$url = $row["productlink"];
header("Location: $url");





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users