this is part of an image upload script i made. I decided to name the rename the images i upload to the time i upload.
date_default_timezone_set('UTC');
$mvTime = date("dmy").(date("H")+5).date("is");
$folder = "images/";
$tmp = imagecreatetruecolor($orig_w, $orig_h);
imagejpeg($tmp, $folder.$mvTime.'.jpg', 100);
now when i upload the image, it saves the image like 051112174700.jpg . its the date in dmyHis format. now i am confused how i show a preview of the image. because the time is changing all the time. thats why i cant use $folder.$mvTime.’jpg’ in the tag src.
can any body help me how i can get the image ?
you can use session for temporally save image names