I have a page that I need to php include a file only IF a category has been selected.
I'm not sure what syntax I need to use, I've tried both the following:
PHP Code:
<?php
if ($cat1=='')
echo "Test";
if ($cat1!='')
include ("gallery.php") ;
?>
and
PHP Code:
<?php
$cat1 = $_POST['cat1'];
if (!isSet($_POST['cat1'])){
echo "<p>Please choose a category!</p>";
}
if (isSet($_POST['cat1'])){
include ("gallery.php") ;
}?>
Both echo the statements when the category is not selected and both display the file regardless...
Any advice would be appreciated!