Hi Dale
Here is the rest of the code within the body of the edit.php page.
The other pages I was referring to were different functions, an approve script and a remove script, but here is the rest of the edit page, along with the code of my first posting, I don't know if this is going to help but if I could just get an idea as to why I'm getting the error (
Error: Classified ID or Password Invalid! Redirecting)
<?PHP
$back = "<a href='sell.php'>Click Here To Go Back And Try Again</a>";
if(isset($GET['upload']) && $FILES['userfile']['size'] > 0)
{
$title = $GET['title'];
$description = $GET['description'];
$category = $GET['category'];
$price = $GET['price'];
$name = $GET['name'];
$number = $GET['number'];
$email = $GET['email'];
$password = $GET['password'];
$id = $_GET['id'];
// PICTURE UPLOAD SYSTEM
$imagename = basename($_FILES['userfile']['name']);
//echo $imagename;
if(empty($imagename)) {
$error = 1;
echo"<h2 class='error'>The name of the image was not found.</h2>".$back; }
if($error != 1 && $noimg != 1)
{
$filename = stripslashes($_FILES['userfile']['name']);
$extension = substr(strrchr($filename, '.'), 1);
$extension = strtolower($extension);
//if it is not a known extension, we will suppose it is an error and will not upload the file,
//otherwise we will do more tests
}
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))
{
//print error message
echo '<h2 class="error">Error. Images Must Be Jpg, Gif, or Png Format! Please Go Back And Try Another Image.</h2>'.$back.'';
$errors=1;
}
else
{
$time = time();
$newimage = "photos/" . $time . $imagename;
//echo $newimage;
$result = @move_uploaded_file($_FILES['userfile']['tmp_name'], $newimage);
if(empty($result)) {
$error = 1;
echo "<h2 class='error'>There was an error moving the uploaded file.</h2><br/>".$back."";
}
$date = date("Y-m-d");
$id = $_GET['id'];
$query = "UPDATE classifieds set title = '$title', description = '$description', cat = '$category', price = '$price', name = '$name', number = '$number', email = '$email', password = '$password', picture = '$newimage', date = '$date' WHERE adid = '$id'";
mysql_query($query) or die(mysql_error());
echo "<div align='justify'><h2 class='success'>Your ad '".$name."' Has Been Updated Successfully!</h2><br/></div>";
}
} elseif(isset($GET['upload'])) {
// No Image SQL for users not posting an image with the Ad.
$title = $GET['title'];
$description = $GET['description'];
$category = $GET['category'];
$price = $GET['price'];
$name = $GET['name'];
$number = $GET['number'];
$email = $GET['email'];
$password = $GET['password'];
$date = date("Y-m-d");
$id = $GET['id'];
$query = "UPDATE classifieds set title = '$title', description = '$description', cat = '$category', price = '$price', name = '$name', number = '$number', email = '$email', password = '$password', picture = 'images/noimage.jpg', date = '$date' WHERE adid = '$id'";
mysql_query($query) or die(mysql_error());
echo "<div align='justify'><h2 class='success'>Your ad '".$title."' Has Been Updated Successfully!</h2><br/></div>";
} else {
$i = $_GET['id'];
if(isset($i)){
$back = "SELECT * FROM classifieds WHERE adid = '$i' limit 1";
$query2 = mysql_query($back) or die (mysql_error());
while($row = mysql_fetch_array($query2, MYSQL_ASSOC)){
$newid = $row['adid'];
$title = $row['title'];
$description = $row['description'];
$category = $row['cat'];
$price = $row['price'];
$name = $row['name'];
$number = $row['number'];
$email = $row['email'];
$password = $row['password'];
$picture = $row['picture'];
$date = date("Y-m-d");
}
?>
<form action="edit.php" onsubmit="return validate_form();" method="get" name="sell" enctype="multipart/form-data">
<input type="hidden" name"pass" value="<?PHP echo $_GET['pass']; ?>"/>
<input type="hidden" name="id" value="<?PHP echo $newid; ?>" /><table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td colspan="2"><span class="style68">Classified Information </span></td>
</tr>
<tr>
<td width="31%"><span class="style64">Title</span></td>
<td width="69%"><input type="text" name="title" class="input" value="<?PHP echo $title; ?>"/></td>
</tr>
<tr>
<td class="style64">Description</td>
<td><textarea name="description" rows="5" class="input"><?PHP echo $description; ?></textarea></td>
</tr>
<tr>
<td class="style64">Classified Category </td>
<td><select name="category" class="input">
<option value="default" selected="selected" style='background-color:#f1f5fa;'>Select A Category</option>
<?PHP
$catquery3 = mysql_query("SELECT * FROM categories");
while($row = mysql_fetch_array($catquery3, MYSQL_ASSOC))
{
echo "<option value='".$row['id']."' style='background-color:#f1f5fa;'>".$row['name']."</option>";
}
?>
</select></td>
</tr>
<tr>
<td class="style64">Price</td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="34%"><table width="91%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" valign="middle"><div align="left"><span class="style62">$</span></div></td>
<td width="38%"><input name="price" type="text" value="<?PHP echo $price; ?>" size="5" maxlength="5" style="background:url(images/pricebg-small.gif); background-position:center; background-repeat:no-repeat;height:45px;width:55px;text-align:center;font-size:28px;font-weight:bold;color:#fff;font-family:Geneva, Arial, Helvetica, sans-serif;border:1px solid #E2ECF5;"/></td>
<td width="48%" valign="middle"><div align="left"><span class="style62">.00</span></div></td>
</tr>
</table> </td>
<td width="21%"><img src="images/arrow-left.png" width="77" height="45" /></td>
<td width="45%"><span class="style60"><strong>Enter Your Price In White </strong><br />
<span class="style57">(Just the dollar value, ex. enter "10" for $10.00, no $ or .00)</span></span></td>
</tr>
</table></td>
</tr>
<tr>
<td height="34" colspan="2" valign="bottom"><span class="style68">Contact Information </span></td>
</tr>
<tr>
<td class="style64">Contact Name </td>
<td><input type="text" name="name" class="input" value="<?PHP echo $name; ?>" /></td>
</tr>
<tr>
<td class="style64">Contact Number </td>
<td><input type="text" name="number" class="input" value="<?PHP echo $number; ?>" /></td>
</tr>
<tr>
<td class="style64">Contact Email </td>
<td><input type="text" name="email" class="input" value="<?PHP echo $email; ?>" /></td>
</tr>
<tr>
<td class="style64">Classified Image<br />
<span class="style57">(Jpg, Gif or Png Formats)</span> </td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<input name="userfile" type="file" class="input" id="userfile"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="style64">Listing Password<br />
<span class="style57">(Used To Delete Ad or Mark as Sold)</span> </td>
<td><input type="text" name="password" class="input" value="<?PHP echo $password; ?>" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="30"> </td>
<td valign="bottom"><input type="submit" name="upload" value="Continue" /></td>
</tr>
</table>
</form><?PHP } } } } ?>