please can anybody

Discussion in 'PHP' started by hakimade, Dec 2, 2008.

  1. #1
    please can anybody tell me how i can run this html with phpscript or where best to host it



    <form method="post" action="sendmail.php">
    Email: <input name="email" type="text" /><br />
    Message:<br />
    <textarea name="message" rows="15" cols="40">
    </textarea><br />
    <input type="submit" />
    </form>



    <?php
    $email = $_REQUEST['email'] ;
    $message = $_REQUEST['message'] ;

    mail( "yourname@example.com", "Feedback Form Results", $message, "From: $email" );
    header( "Location: http://www.example.com/thankyou.html" );
    ?>
     
    hakimade, Dec 2, 2008 IP
  2. JREAM

    JREAM Member

    Messages:
    160
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #2
    You need the bottom chunk of php code in a file named sendmail.php in the same directory as the top chunk of code which could be index.html or contact.html
     
    JREAM, Dec 2, 2008 IP
  3. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #3
    index.html
    <form method="post" action="sendmail.php">
    Email: <input name="email" type="text" /><br />
    Message:<br />
    <textarea name="message" rows="15" cols="40">
    </textarea><br />
    <input type="submit" />
    </form>
    PHP:
    sendmail.php
    <?php
    $email = $_REQUEST['email'] ;
    $message = $_REQUEST['message'] ;
    
    mail( "yourname@example.com", "Feedback Form Results", $message, "From: $email" );
    header( "Location: http://www.example.com/thankyou.html" );
    ?>
    PHP:
     
    misbah, Dec 2, 2008 IP
  4. hakimade

    hakimade Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    but try that but not working
     
    hakimade, Dec 2, 2008 IP