ArizonaJohn Posted June 3, 2009 Share Posted June 3, 2009 Hello, The if statement below works great. However, I would like the user to be directed to a new page called search2.php if the statement is true. Is there a way to do that? Thanks, John $anymatches=mysql_num_rows($result); if ($anymatches == 0) { } Link to comment https://forums.phpfreaks.com/topic/160748-solved-using-an-if-statement-to-open-a-new-page/ Share on other sites More sharing options...
Ken2k7 Posted June 3, 2009 Share Posted June 3, 2009 header for redirect, but if you want to open a new page, you'll need to use JavaScript. It's not something PHP can do. Link to comment https://forums.phpfreaks.com/topic/160748-solved-using-an-if-statement-to-open-a-new-page/#findComment-848368 Share on other sites More sharing options...
ArizonaJohn Posted June 3, 2009 Author Share Posted June 3, 2009 Hey ken2k7, Thanks for the help. I found out from your link that header() works, but only if ob_start(); is placed under the first PHP tag. Regards Link to comment https://forums.phpfreaks.com/topic/160748-solved-using-an-if-statement-to-open-a-new-page/#findComment-848390 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.