PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
manojsemwal1
Forum Contributor
Posts: 217 Joined: Mon Jun 29, 2009 4:13 am
Location: India
Post
by manojsemwal1 » Tue Jun 30, 2009 8:03 am
Hai friend anybody know that how to add date and time to uploaded image
my script are like:
Code: Select all
$path= move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
//echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
$path="upload/" . $_FILES["file"]["name"];
echo "manoj".$path;
here where we have to add date and time.
regards,
Manoj
Last edited by
Benjamin on Tue Jun 30, 2009 10:43 am, edited 1 time in total.
Reason: Added [code=php] tags.
Eric!
DevNet Resident
Posts: 1146 Joined: Sun Jun 14, 2009 3:13 pm
Post
by Eric! » Tue Jun 30, 2009 12:42 pm
What do you want to add the date and time to?
You can get the files information using filemtime
Code: Select all
if (file_exists ($file))
{
$time = filemtime ($file);
$year = date ("Y", $time);
$month = date ("m", $time);
$day = date ("d", $time);
$hour = date ("H", $time);
$minutes = date ("i", $time);
$seconds = date ("s", $time);
echo $year . $month . $day . '_' . $hour . $minutes . $seconds . "\n";
}
manojsemwal1
Forum Contributor
Posts: 217 Joined: Mon Jun 29, 2009 4:13 am
Location: India
Post
by manojsemwal1 » Wed Jul 01, 2009 12:01 am
pl tell me how te rename file while uploading in the server......