I have a PHP page that is included in another.
So let's say foo.php is included in bar.php
I call www.domain.com/bar.php?cat=bearings
This is the code in foo.php
if ($GET['cat']=" ") {
$query = "SELECT FROM parts ORDER BY id DESC";
print "showcat = nothing";
print $GET['cat'];
} else {
$showcat=$GET['cat'];
$query = "SELECT FROM parts WHERE category = \"$showcat\"";
print "showcat = something";
print $GET['cat'];
}
However each time $_GET['cat']; returns blank.
I can do the same thing with a simpe page like this...
<?php
print $_GET['cat'];
?>
and it works with whatever I pass it. (e.g. test.php?cat=stuff returns stuff)
any clues...?