Results 1 to 10 of 10

Thread: Sending a Form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    Talking Sending a Form

    I know this has been asked many times, but I could never find a straight answer. I wanted to know how to send a Form of information to my e-mail using PHP. For example I would use textfields in a form to hold inforamtion like there name, e-mail, birth date, etc. How would I send that information to my e-mail address using php?

    PS: I'm using dreamweaver, if that helps any.

    Thanks,
    TheHolyHessiah

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Sending a Form

    PHP Code:
    //get values from submitted form
    $name $_POST['txtname'];
    $email $_POST['txtemail'];
    //etc....

    //content of email message
    $message $name " submitted your form with an email address of " .$email;
    //Send email
    mail("[email protected]","Form Details",$message); 

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    Re: Sending a Form

    how could that work if you don't have to enter a password or go through SMTP?

  4. #4
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Sending a Form

    PHP has build in support for sending emails thought SMTP. So you don't need to enter a password or use sockets. For more info about using the mail command check this out http://uk2.php.net/mail

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    Re: Sending a Form

    I'm a little new at PHP, the only complex thing I know is MySQL.

    Thanks,
    TheHolyMessiah

  6. #6
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: Sending a Form

    To email the html form use frontpage extensions. In this way, you need not write any server side code and the whole form with well formatted data will be emailed where you want.

    Another way is to use server side PHP script. I have a PHP file (I downloaded it somewhere), if you post any of your form to that file, regardless of any number of fields you have, it will email you the entire data of the form. Let me know if you need it.

    Thanks.

  7. #7
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Sending a Form

    Quote Originally Posted by usamaalam
    To email the html form use frontpage extensions. In this way, you need not write any server side code and the whole form with well formatted data will be emailed where you want.
    This is only good if you are on windows hosting, but if you want more freedom from your script you really need to write your own scripts.

  8. #8
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: Sending a Form

    I just implemented frontpage extensions on linux hosting.

  9. #9
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Sending a Form

    I stand corrected, though have had nothing but grief when trying to use Frontpage Extensions.

  10. #10
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: Sending a Form

    I don't know much about PHP hosting, I'm new to PHP, but I'm using 1and1 hosting on linux server and it has frontpage extensions. I implemented it yesterday and everything is working fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width