SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Adam Black's Avatar
    Join Date
    Oct 2000
    Location
    Nova Scotia, Canada
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how can i make a form mailer script with PHP

    how can i make a form mailer script with PHP?
    I am very new to php.
    the form is:
    <form method=GET action="contactform.php">
    Your Nameinput type="text" name="name"><br>
    Your E-Mailinput type="text" name="email"><br>
    Comments/Questions/Suggestions/etc.<br>
    <textarea name="questcomment" rows="6" cols="50">
    </textarea><br>
    <input type="submit" value="Submit"><p>
    and i don't know how to like get this information mailed to my e-mail adress.

  2. #2
    SitePoint Zealot
    Join Date
    Dec 1999
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all, use method=POST instead of GET in your form.

    The script would be something like this:

    PHP Code:
    $message "A message from $name ({$email})\n\n";
    $message .= $questcomment;

    if(
    mail("you@yourmail.com","Some subject",$message)) echo("Message succesfuly sent. Thank you."); 

  3. #3
    SitePoint Enthusiast Adam Black's Avatar
    Join Date
    Oct 2000
    Location
    Nova Scotia, Canada
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i made the script what you said and stuff but when i click submit in the form is does this:

    The page cannot be displayed
    The page you are looking for cannot be displayed because the address is incorrect.

    --------------------------------------------------------------------------------

    Please try the following:

    If you typed the page address in the Address bar, check that it is entered correctly.

    Open the www.nethorde.com home page and then look for links to the information you want.
    Click Search to look for information on the Internet.



    HTTP 405 - Resource not allowed
    Internet Explorer
    I have it linking to the file and it is the right filename and stuff?? do you know what is wrong?

  4. #4
    SitePoint Zealot
    Join Date
    Dec 1999
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No idea. Itīs not a code problem since I tested it here and it works perfectly. Try talking to your host to see if they know the answer.

    Edit: You can download mail.php source from http://www.mycgiserver.com/~elmundonobasta/mailphp.txt
    Last edited by PGA; Sep 22, 2001 at 08:45.


Bookmarks

Posting Permissions

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