email uploaded image
Moderator: General Moderators
-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
email uploaded image
Hello,
I now have a form on my site for the clients to fill in all their details aswell as upload an image.
Now I would need for when they click the submit button ,that the information they submitted aswell as the image they uploaded are displayed. AND it also needs to be emailed to me in one email with the uploaded image as an attachement to the email with the details submitted.
How can I do this?
I now have a form on my site for the clients to fill in all their details aswell as upload an image.
Now I would need for when they click the submit button ,that the information they submitted aswell as the image they uploaded are displayed. AND it also needs to be emailed to me in one email with the uploaded image as an attachement to the email with the details submitted.
How can I do this?
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
go to the php manual, look up file upload and mail.
eh..
http://us2.php.net/features.file-upload
http://us2.php.net/manual/en/function.mail.php
though for mail i recommend using
http://phpmailer.sourceforge.net/
eh..
http://us2.php.net/features.file-upload
http://us2.php.net/manual/en/function.mail.php
though for mail i recommend using
http://phpmailer.sourceforge.net/
-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
The code is rather long as I have about a hundred switch cases in it.
but the problem that i dont understand is. After people click submit , there image should be displayed on the thank you page.
But don't you need to know the url to display and image? I know the folder where the images should be moved to , but if i want to show them , i need to use echo '..... right? but what comes after echo?
but the problem that i dont understand is. After people click submit , there image should be displayed on the thank you page.
But don't you need to know the url to display and image? I know the folder where the images should be moved to , but if i want to show them , i need to use echo '..... right? but what comes after echo?
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
i have this :
it copies the image to a folder called files. But it doesnt change the name.
So wot do I put to display this image on the thankyou page?
Argh it's all confusing me way too much lol
Code: Select all
copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])
or die ("Could not copy");So wot do I put to display this image on the thankyou page?
Argh it's all confusing me way too much lol
Code: Select all
echo "<img src="files/".$_FILES['imagefile']['name']." />";-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
if i make a seperate form for the image upload and i put
it does work and moves and saves the image in a folder called files
but if i put it in an existing form that also has text input and all , it doesnt work and the image isnt uploaded nor saved in that folder.
Also even if i use a seperate form for the file upload , I can't manage to get the image displayed on the thank you page.
Can anybody please help me?
I also need the image together with the text my users wrote in the form to be emailed to me , and that won't work either
Code: Select all
copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])
or die ("Could not copy");but if i put it in an existing form that also has text input and all , it doesnt work and the image isnt uploaded nor saved in that folder.
Also even if i use a seperate form for the file upload , I can't manage to get the image displayed on the thank you page.
Can anybody please help me?
I also need the image together with the text my users wrote in the form to be emailed to me , and that won't work either
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
-
ben_albrechts
- Forum Commoner
- Posts: 33
- Joined: Wed Oct 26, 2005 3:33 am
Code: Select all
echo "<img src="files/".$_FILES['imagefile']['name']." />";