Link to home
Start Free TrialLog in
Avatar of freeaj
freeaj

asked on

Send picture using php?

I have a .php file with the following code:


<head>
<META HTTP-EQUIV="Refresh"
      CONTENT="0; URL=http://www.freewebtown.com/year3/thanks4.html">
        </head>
        <CENTER><font face="Arial" size"3">Thanks! You have successfully filled in the form.<BR><BR><font face="6"><b>Please wait!
<body><script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "adam****en@hotmail.com";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
</body>



This works briliantly when people enter values into a form...
However, is it possible to send pictures through php? I would love to know how to do one of the following things:
1) send a picture on screen to me (in any format) through e-mail, or to publish on another website ready for me to take a look (- is there a website that does this?)
2) to have a 'browse' button automatically upload an image and send to me through e-mail

I have found code that allows me to put a picture drawn on screen into a .jpg (http://members.lycos.co.uk/bickleigh/sign4.html), but don't know how to take it from there.


What am I doing? I want some children on my website to draw pictures and add it to a gallery...!

Thanks in advance,
Adam.
Avatar of pigmentarts
pigmentarts
Flag of United Kingdom of Great Britain and Northern Ireland image

The simplest way - in the body if the email client that receives it accepts HTML, you can just include an image

Eg.
In the body of the code above:

<img src="http://where-my-image-is-stored.com/some-image.jpg" alt="test />

That’s the nice and easy way, if not you will need to file browse, and be able to add it as a attachment to the email etc
ASKER CERTIFIED SOLUTION
Avatar of SoyYop
SoyYop

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of freeaj
freeaj

ASKER

Yes! Thanks SoyYop!