I've been messing with the $_POST global and just can;t get any info from it.
I've got a few dynamically created buttons and all I want is to be able to click on a button, reload the page and then be able to find out by accessing that $_POST item if it was set or not.
Here's how my buttons are created
Code: Select all
function category_buttons(& $filename)
{
echo "<FORM ACTION="review.php" METHOD="post">\n";
echo "<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=5>\n";
echo "<TR>\n";
foreach ($filename AS $item => $file)
{
if (file_exists($file)) //If the file exists, give the darn thing a button!
{
echo "<TD><INPUT TYPE="submit" name="category" value="$item"></TD>\n";
}
}
echo "</TR></TABLE></FORM>\n";
}
So consider the buttons to be called animals, people, food. If I click on the animals button, I just want the $_POST['animals'] to be able to be picked up as set when the page reloads. User clicks on the button, reloads the same page with
Code: Select all
if (isset($_POSTї'animals']))
equal to true.
Right now, I'm not getting squat. Here's the chunk of code that should be able to pickup if the $_POST var was set
Code: Select all
function review_items(& $filename, & $num_files)
{ //User gets to play God
if ($num_files > 1)
{
echo "<h3 align=center>Select an category to judge</h3>\n";
category_buttons($filename); //Create category buttons
}
if (isset($_POSTї'category'])) //A cateory has been selected
{
$category = $_POSTї'category'];
echo "<p align=center>Currently judging "" . $category . ""</p>\n";
gen_table_item($category, $filenameї$category]);
}
else
{
echo "<p align=center>No category currently selected</p>\n";
}
}
What am I doing wrong?!
Paul