kuttus011 — 2010-04-10T08:54:38-04:00 — #1
Hello friends... can help me to upload the image to an folder how can i do it pls tell and i need to display it from the folder...pls help me through the coding where i need to pass all type of imagess like jpg,png,gif after all i need it very urgent if you can pls explain me through the codes....
jake_arkinstall — 2010-04-10T09:07:24-04:00 — #2
We aren't here to do your work for you.
So, try it yourself and if you have problems, come back.
kuttus011 — 2010-04-10T09:42:09-04:00 — #3
hello friend i have the code to upload the image but the problem comes for me how to call it back from folder like how can i tell i need to make the folder automatically and upload the image inside tht and display the image to the page... i know how to make the uploading but how to create a folder automatically and display the image from their thts the doubt for me
jake_arkinstall — 2010-04-10T09:46:20-04:00 — #4
Ok, well to create a folder you use the mkdir() function - to see if it already exists use file_exists:
$Directory = 'Uploads'
mkdir($Directory) or die('Cannot create upload directory. @Admin: Make sure permissions are correct');
To display the image:
printf('<img src="%s/%s" alt="uploaded image" />', $Directory, $ImageName);
If you need more assistance, can you post what code you have at the moment?
kuttus011 — 2010-04-10T10:08:19-04:00 — #5
ok friend thank you for the responce see wht i have done for the image uploading while uploading any 1 will upload with the same name of the image which is already their in the folder... to avoid this i addded the time(). function with the image name so the thing is that the problems comes if the user gone and he will come back in his login file he should see all his images from the folder tht i know how to do but i dont know how to delete this image from the folder...... if you know tell me and thank for the helping mentality really i am new to this image php play thts why..