kev wood Posted June 3, 2008 Share Posted June 3, 2008 is it possible to get the if else statement to load a page on the else condition. i have spent a couple of hours looking around and al the examples i can find just use the echo function to get it to print something out on the screen. i want it to be able to redirect the user. a link to a good tutorial of example code would be great. Link to comment https://forums.phpfreaks.com/topic/108495-solved-ifelse-statement/ Share on other sites More sharing options...
GingerRobot Posted June 3, 2008 Share Posted June 3, 2008 Of course: <?php if($condition===true){ header("location:true.php"); }else{ header("location:false.php"); } ?> You should note that you cannot send any output to the browser prior to changing location like this. Link to comment https://forums.phpfreaks.com/topic/108495-solved-ifelse-statement/#findComment-556315 Share on other sites More sharing options...
kev wood Posted June 3, 2008 Author Share Posted June 3, 2008 thanks for the reply. i will not need to send any output the page they are redirected to will just tell the user they have reached there daily limit. Link to comment https://forums.phpfreaks.com/topic/108495-solved-ifelse-statement/#findComment-556317 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.