Im trying to make a page that i can edit individual records from my database on. The following is part of the code for the page that passes along the variable.
When someone hits the edit button for one of teh records, the correct page opens(cust_edit.php) and the url reflects the customer ID of that record (i.e. sliquid.com/protected/cust_edit.php?customerID=xxx)
$search_results .= "
<tr align=center bgcolor=".$color.">
<td><font face=\"Tahoma\" size=\"1\">$row[firstname]</font></td>
<td><font face=\"Tahoma\" size=\"1\">$row[lastname]</font></td>
<td><font face=\"Tahoma\" size=\"1\">$row[city]</font></td>
<td><font face=\"Tahoma\" size=\"1\">$row[state]</font></td>
<td><font face=\"Tahoma\" size=\"1\"><a href=\"mailto:$row[email]\">$row[email]</a></font></td>
<td><font face=tahoma size=1><form action='cust_edit.php'><input type='hidden' name='customerID' value='$row[customerID]'><input type='submit' value='Edit'></form></font></td>
</tr>";
OK, so that is working correctly from what I can tell. So now heres the page that grabs the ID, and lets me edit the record.
Im trying to keep it simple until it works, so theres only some of the echo code there.
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');
include("dbconnection.php");
$id=$_GET['customerID'];
$result = odbc_query("SELECT * FROM customers WHERE customerID='$id' ",$cnx);
while($myrow = odbc_fetch_assoc($result))
{
echo"
$firstname= $row[firstname];
$lastname= $row[lastname];
$address1= $row[address1];
$address2= $row[address2];
$city= $row[city];
$state= $row[state];
$zip= $row[zip];
$email= $row[email];
$referral= $row[referral];
$lubricant= $row[lubricant];
<!-- Your Form Stuff here -->
<input type=\"hidden\" name=\"customerID\" value=\"<? echo $id; ?>\">
First Name:<br>
<input type=\"text\" name=\"firstname\" value=\"<? echo $firstname; ?>\">
<br>
Last Name:<br>
<input type=\"text\" name=\"lastname\" value=\"<? echo $lastname; ?>\">
"
}
?>
all i get when I hit submit on the previous page is this page, blank, with no error reported. Viewing source shows me nothing either, just
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
any ideas?