HELP!!!
| From: | Will | Date: | Sat, 21 Feb 2004 21:46:54 +0000 |
| Subject: | HELP!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-178456@lists.php.net to get a copy of this message | ||
Hello All,
I am trying to do a modify script. The problem is I can get only one thig to work, it is either the tables modified or the photos uploaded not both here is my code:
HTML FORM:
<p><b>Image File Name:</b><br>
<input type="text" name="female_image" value="<?echo $female_image;?>" size="30" maxlenght="200"></p>
<p><b>Image Thumbnail File Name:</b><br>
<input type="text" name="female_image_thumb" value="<?echo $female_image_thumb;?>" size="30" maxlenght="200"></p>
<p><b>Image File:</b><br>
<input type="file" name="application" size="20" maxlenght="200"></p>
<p><strong>Image Thumbnail File Name:</strong><br>
<input type="file" name="application1" size="20" maxlenght="200"></p>
<p><input type="submit" name="submit" value="Modify This Female Reptile"></p>
NOTE: This is only the last part of the form.
AND THE PHP SCRIPT:
?>
$sql = "UPDATE $table_name9 SET
female_latin = '$_POST[female_latin]',
female_born_date = '$_POST[female_born_date]',
female_date = '$_POST[female_date]',
female_where_purchased = '$_POST[female_where_purchased]',
female_cost = '$_POST[female_cost]',
female_size = '$_POST[female_size]',
female_weight = '$_POST[female_weight]',
female_humidity_level = '$_POST[female_humidity_level]',
female_notes = '$_POST[female_notes]',
female_image = '$_POST[female_image]',
female_image_thumb = '$_POST[female_image_thumb]'
WHERE female_id = '$_POST[female_id]'";
$result = @mysql_query($sql,$conn) or die(mysql_error());
if ($_FILES[application] != "") {
header ("Location: main.php");
exit;
} else {
@copy($_FILES[application][tmp_name], "$path" .$_FILES[application][name])
or die( "Sorry Could not copy file!!" );
@copy($_FILES[application1][tmp_name], "$path1" .$_FILES[application1][name])
or die( "Could not copy file!!" );
header("Location: main.php");
exit;
}
?>
NOTE This is the whole script minus the setup file.
Thanks in advance,
~WILL~