Here's the form on the first page:
<form action="delete.php" method="post">
<input type="hidden" name="listid" value="<? echo "$listid"; ?>" />
<input type="hidden" name="photo" value="<? echo "$photo"; ?>" />
<input type="submit" name="submit" id="submit" value="Yes, DELETE Listing" />
</form>
I've check the actual page source and the correct variables appear in their respective spots.
Here's the next page, which for some reason is not catching the variables $listid and $photo at all! So, essentially the code below does nothing. I can't figure out for the life of me why my variables are not carrying as $_POST values.
<?
session_start();
include ("logininfo.inc");
$listid = $_POST['$listid'];
$photo = $_POST['photo'];
echo "Listing # $listid<BR>";
$conn = mysql_connect($host, $user,$password) or die ("Couldn't connect to server.");
$mdb = mysql_select_db($database, $conn) or die ("Couldn't select database.");
$query = "DELETE FROM 'listings' WHERE 'listid' = '$listid' LIMIT 1";
$result = mysql_query($query);
if (isset($photo) && $photo !=="")
{
$imagefile = "../images/" . $photo;
$thumbfile = "../thumbs/" . $photo;
if (file_exists($imagefile)) {@unlink($imagefile);}
if (file_exists($thumbfile)) {@unlink($thumbfile);}
}
echo "Listing and all images deleted. Click <a href=\"index.php\">here</a> to go back.";
?>