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] Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/ 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 Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113382 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 ;) Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113384 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 Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113390 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] Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113402 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. Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113405 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 Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113406 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] Link to comment https://forums.phpfreaks.com/topic/24876-forwarding-to-a-new-page/#findComment-113407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.