Ugh! The troubles this thing is giving me.. my first issue has been resolved, though I don't know why. The code that works now is EXACTLY what I posted previously. Oh well.
Now I'm having trouble passing the variables to the next if() portion of the script.
<?php
if ($loaddata)
{
$db = mysql_connect("localhost", "user");
mysql_select_db("bairey",$db);
$sql = "SELECT * FROM content WHERE animal = '$animal' AND category = '$category'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$editanimal = $myrow["animal"];
$editcategory = $myrow["category"];
$editcomment = $myrow["comments"];
echo "edit-a: ";
echo $editanimal;
echo "<br>edit-c: ";
echo $editcategory;
?>
**These return correctly.
<center><form method=post action="<?php echo $PHP_SELF ?>">
<textarea name=newcomments><?php echo $editcomment ?></textarea>
<input type=submit value=Update name=submit></form>
<?php
} //end load data if
else
{
} // end load data else
?>
<?php
if ($submit)
{
$passedanimal = $HTTP_POST_VARS['animal'];
$passedcategory = $HTTP_POST_VARS['category'];
echo "<br>sub-a: ";
echo $passedanimal;
echo "<br>sub-c: ";
echo $passedcategory;
echo "<br>sub-ha: ";
echo $HTTP_POST_VARS['animal'];
echo "<br>sub-hc: ";
echo $HTTP_POST_VARS['category'];
echo "<br>sub-edit-a: ";
echo $editanimal;
echo "<br>sub-edit-c: ";
echo $editcategory;
** NONE of these have any value.
My host has track_vars disabled, and won't turn them on. I am putting <?php_track_vars?> at the top of this script, but it doesn't seem to be working - I put phpinfo() further down, and it shows track_vars disabled at both master and local.
ANYTHING that will pass these variables to the if($submit) function would be appreciated! I've tried writing my own functions, assigning them globally, etc. but I guess I'm missing something.
Thanks!