This is what I have so far - but the actual file upload does not seem to be working - It does add the data in database but the actual file is missing. when I look at the path to the image the file is not there.
<div align="center"><b>EDIT AREA</b></div>
<form name="form1" method="post" action="<?=$_SERVER["PHP_SELF"] ?>">
<?php
if ($Submit)
{
$resultID = mysql_query("UPDATE database SET address = '$address', city = '$city', state = '$state',
zip = '$zip', proptype = '$proptype', agname = '$agname', agemail = '$agemail', description = '$description'
WHERE id = '$id'") or die(mysql_error());
if ($resultID == TRUE) {
print "Record has been successfully edited!";
} else {
print "Sorry, but record has not been successfully edited, try again";
}
}
?>
<?php $query="SELECT * FROM database WHERE id = '$id'";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)) {
$address = $row['address'];
$city = $row['city'];
$state = $row['state'];
$zip = $row['zip'];
$proptype = $row['proptype'];
$agname = $row['agname'];
$agemail = $row['agemail'];
$description = $row['description'];
}
?>
<table width="52%" border=1 align=center>
<tr>
<td><strong>Address</strong></td>
<td><input name="address" type="text" id="address" value="<?php echo "$address"; ?>"></td>
</tr>
<tr>
<td width="24%"><strong>City</strong></td>
<td width="76%"><input name="city" type="text" id="city" value="<?php echo "$city"; ?>"></td>
</tr>
<tr>
<td><strong>State</strong></td>
<td><input name="state" type="text" id="state" value="<?php echo "$state"; ?>"></td>
</tr>
<tr>
<td width="24%"><strong>Zip</strong></td>
<td width="76%"><input name="zip" type="text" id="zip" value="<?php echo "$zip"; ?>"></td>
</tr>
<tr>
<td width="24%"><strong>Property type</strong></td>
<td width="76%"><input name="proptype" type="text" id="proptype" value="<?php echo "$proptype"; ?>"></td>
</tr>
<tr>
<td width="24%"><strong>Agent name</strong></td>
<td width="76%"><b><input name="agname" type="text" id="agname" value="<?php echo "$agname"; ?>"></b></td>
</tr>
<tr>
<td width="24%"><strong>Agent email</strong></td>
<td width="76%"><input name="agemail" type="text" id="agemail" value="<?php echo "$agemail"; ?>"></td>
</tr>
<tr>
<td width="24%"><strong>Description</strong></td>
<td width="76%"><textarea name="description" cols="35" rows="6" value="<?php echo "$description"; ?>"><?php echo "$description"; ?></textarea></td>
</tr>
<TR>
<TD> Upload Photo: </TD>
<TD><input name="foto2" type="file">
.jpeg only</TD>
</TR>
<TR>
<TD> </TD>
<TD><input type="submit" name="Submit" value="Submit">
<input type="reset" name="reset" value="Reset">
<input type="button" name="button" value="Cancel" onclick="javascript:window.location='admina.php'">
</TD></TR>
</table>