Welcome to TalkGraphics.com
Results 1 to 4 of 4
  1. #1

    Default Help with PHP Script? for Contact Form...

    Hello,

    I was pointed to this nice little contact form by a forum member and it is working well but I would like to change the message after the submit button is pressed.

    Right now, a white page come up with a message stating thank you, we will get back to you as soon as possible. But there is no link back to the previous page or homepage.

    Does anybody know what script I would add to get a link back to the previous page?

    Or is there a simple way to have it return automatically after 10 seconds?

    Here is the code for the contact form:

    <?PHP
    $to = "youremail@wherever.com";
    $subject = "Contact Form response";
    $headers = "From: Form Mailer";
    $forward = 0;
    $location = "";

    $date = date ("l, F jS, Y");
    $time = date ("h:i A");



    $msg = "Below is a message from your contact form submitted on $date at $time.\n\n";

    if ($_SERVER['REQUEST_METHOD'] == "POST") {
    foreach ($_POST as $key => $value) {
    $msg .= ucfirst ($key) ." : ". $value . "\n";
    }
    }
    else {
    foreach ($_GET as $key => $value) {
    $msg .= ucfirst ($key) ." : ". $value . "\n";
    }
    }

    mail($to, $subject, $msg, $headers);
    if ($forward == 1) {
    header ("Location:$location");
    }
    else {
    echo "Thank you for contacting us. We will get back to you as soon as possible.";
    }

    ?>


    Thanks for your help for the code-challenged!

  2. #2
    Join Date
    Aug 2007
    Location
    Maghull UK
    Posts
    6,202

    Default Re: Help with PHP Script? for Contact Form...

    See step 4 of the tutorial here
    JOHN -XaReg (FB) XaReg (DB - ignore prompt to register)
    Windows 10 [Anniversary] pro Intel Pentium CPU G630 @ 2.70Ghz RAM: 4 GB; 64-bit x64

  3. #3

    Default Re: Help with PHP Script? for Contact Form...

    Thank you very much! Works great.

  4. #4
    Join Date
    Aug 2007
    Location
    Maghull UK
    Posts
    6,202

    Default Re: Help with PHP Script? for Contact Form...

    Glad to help :-)
    JOHN -XaReg (FB) XaReg (DB - ignore prompt to register)
    Windows 10 [Anniversary] pro Intel Pentium CPU G630 @ 2.70Ghz RAM: 4 GB; 64-bit x64

 

 

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
  •