Send picture using php?

Posted on 2006-05-31
Last Modified: 2010-10-05
I have a .php file with the following code:

      CONTENT="0; URL=">
        <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****";
$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); }

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 (, 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,
Question by:freeaj
    LVL 12

    Expert Comment

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

    In the body of the code above:

    <img src="" 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
    LVL 7

    Accepted Solution


    Author Comment

    Yes! Thanks SoyYop!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Dreamweaver CC 2015

    Adobe Dreamweaver Creative Cloud is used by web designers and front-end developers and allows you to visualize your site in real-time as you code. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now