nearly there...just one more
| From: | will hives | Date: | Thu, 24 Jan 2002 22:11:45 +0000 |
| Subject: | nearly there...just one more | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-81979@lists.php.net to get a copy of this message | ||
I have managed to set the file upload to change the name of the file when
uploading, but when the file is uploaded it takes the original file name not
the renamed one....
image upload box is named 'picture' how do I get it to call the new file
name????
Thank you for your help so far everyone...
<?
$db_name = "altdb";
$table_name = "main";
$connection = @mysql_connect("www.main.net", "main", "main") or die
("couldn't connect.");
$db = @mysql_select_db($db_name, $connection) or die ("couldn't select
database.");
$sql = "INSERT INTO $table_name (id, name, email, picture_name)
VALUES ('$id', '$name', '$email', '$picture_name') ";
$result = @mysql_query($sql, $connection) or die ("couldn't execute query");
if ($picture != "") {
$path = "/home/main/main/php/";
$datee = date("sdFy");
copy($picture,$path . $datee . $picture_name);
}
?>