celestineweb Posted April 13, 2006 Share Posted April 13, 2006 The script below calls other scripts to build the page.<?include '../ssi/top.php';include '../ssi/left_nav.php';include '../ssi/headline1.php';include '../ssi/headline2.php';include '../ssi/headline3.php';include '../ssi/advert1.php';include '../ssi/content.php';include '../ssi/right_nav.php';include '../ssi/footer.php';?>This is part of the content.php script:-$query="SELECT * FROM users WHERE country='$country' ORDER BY last_name ASC";$result=mysql_query($query);$num=mysql_numrows($result);//error checking countryif ($num<=0) {echo "we do not have anyone listed in this country yetplease press back button to make another selection";exit;}If the 'if' statement is true the script exits and does not action :-include '../ssi/right_nav.php';include '../ssi/footer.php';in the layout page.Is there a way round this, I have tried including the above in the if statement and read throught the books but cannot find a solution. If I remove the exit statement the page loads ok but also shows results from the database that are not wanted. Link to comment https://forums.phpfreaks.com/topic/7309-template-layout/ Share on other sites More sharing options...
celestineweb Posted April 13, 2006 Author Share Posted April 13, 2006 Ok I solved it:-if ($num<=0) {echo "we do not have anyone listed in this town yetplease press back button to make another selection";?></div><?include '../ssi/right_nav.php';include '../ssi/footer.php';exit;}If anyone has a nicer way of doing this please let me know Link to comment https://forums.phpfreaks.com/topic/7309-template-layout/#findComment-26602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.