almightyegg Posted October 23, 2006 Share Posted October 23, 2006 how do i forward toa different page from an if()this should explain:[code=php:0]if($mem[clutch] == 0){//if it does equal 0, forward to visit.php}else{//page go's here! (if it equals anything other than 0)}[code=php:0] Quote Link to comment Share on other sites More sharing options...
jwk811 Posted October 23, 2006 Share Posted October 23, 2006 [code]<?phpif($mem[clutch] == 0){header("Location: visit.php");}else{header("Location: page.php");}?>[/code]pretty sure you could do it that way Quote Link to comment Share on other sites More sharing options...
almightyegg Posted October 23, 2006 Author Share Posted October 23, 2006 nope didn't work :( but thanks anyway :)i think it was because it said header, and i want to forward the page and not adapt header ;) Quote Link to comment Share on other sites More sharing options...
fert Posted October 23, 2006 Share Posted October 23, 2006 http://www.phpfreaks.com/quickcode/Redirect/532.php Quote Link to comment Share on other sites More sharing options...
almightyegg Posted October 23, 2006 Author Share Posted October 23, 2006 nope that still didn't work....maybe i made an error...[code=php:0]if($mem[clutch] == 0){function redirect($time, "$link") {echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$link}\" /> ";}Redirect(0, "http://www.lordoftheabyss.com/society/visit.php");}else{//normal page here}[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted October 23, 2006 Share Posted October 23, 2006 php is case sensative.[code=php:0]function redirect($time, $link) { echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$link}\" /> ";}if($mem[clutch] == 0) { redirect(0, "http://www.lordoftheabyss.com/society/visit.php");} else {//normal page here}[/code]ps: The [url=http://php.net/header]header[/url] method is how it is done in php. Quote Link to comment Share on other sites More sharing options...
almightyegg Posted October 23, 2006 Author Share Posted October 23, 2006 still get:Parse error: syntax error, unexpected '"', expecting '&' or T_VARIABLE or T_CONST in /home/lordofth/public_html/society/mysociety.php on line 68 Quote Link to comment Share on other sites More sharing options...
trq Posted October 23, 2006 Share Posted October 23, 2006 [code=php:0]function redirect($time, $link) { echo "<meta http-equiv=\"refresh\" content=\"{$time}\"; url=\"{$link}\" /> ";}[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.