redirect with php
Posted: Thu Jun 28, 2012 8:12 am
I am trying to have a page redirect if a setting is enabled. i have tried the meta refresh but the page keeps refreshing over and over if i could stop it after 1 time it would work. I also have tried header but i get a header error as always
Does anyone have any ideas how to use one of these to make it work.?
here is the code i am using
anyhelp would be great
Does anyone have any ideas how to use one of these to make it work.?
here is the code i am using
Code: Select all
if($sign['random_referral']=='1') {
$sql = "SELECT username FROM members ORDER BY RAND() LIMIT 1";
$res = mysql_query($sql);
$row = mysql_fetch_assoc($res);
$var1 = $row['username'];
header("Location: signup.php?ref='.$var1.'");
exit;
}