Jump to content

Archived

This topic is now archived and is closed to further replies.

celestineweb

Template layout

Recommended Posts

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 country
if ($num<=0)
{
echo "we do not have anyone listed in this country yet
please 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.

Share this post


Link to post
Share on other sites
Ok I solved it:-

if ($num<=0)
{
echo "we do not have anyone listed in this town yet
please 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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.