website form php problem

php , form , dreamweaver , filezilla Ipswich, United Kingdom
  • 11 years ago

    I have recieved a standard php script from our host company and have tested their script. Here are the details and if you or a colleague can offer any advice I would greatly appreciate it.

    I opened the 'feedback.php' script from the host company and replaced the email addresses so I could test it (as below).

  • 11 years ago

    I have recieved a standard php script from our host company and have tested their script. Here are the details and if you or a colleague can offer any advice I would greatly appreciate it.

    I opened the 'feedback.php' script from the host company and replaced the email addresses so I could test it (as below).

  • 11 years ago
  • 11 years ago
    <?php
    

    // Configuration Settings $SendEmail = "[email protected]"; //sender name $SendName = "Website Contact Form"; //sender e-mail

    $SendTo = "[email protected]"; //recipient

    $SubjectLine = "Contact Form"; $ThanksURL = "index.html"; $Divider = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";

    $SendFrom = "From: ". $SendName . " <" . $SendEmail . "> \r\n";

    $MsgBody = @gethostbyaddr($REMOTEADDR) . "\n$Divider\n"; foreach ($POST as $Field=>$Value) $MsgBody .= "$Field: $Value\n"; $MsgBody .= $Divider . "\n" . $HTTPUSERAGENT . "\n"; $MsgBody = htmlspecialchars($MsgBody);

    mail($SendTo, $SubjectLine, $MsgBody, $SendFrom, '-f'.$SendEmail); header("Location: $ThanksURL");

    ?>

    I then saved this into the 'pages' folder on the www.eastanglianentertainments.co.uk site. To test this script I created a new simple webpage with only a small form on it. The new form links to the 'feedback.php' that I recived. The new page can be found here: http://www.eastanglianentertainments.co.uk/pages/eae_contact3.html

    When clicking the 'Submit' button the browser the status bar says 'Done" but no email is delivered and the response URL opens the following link: http://www.eastanglianentertainments.co.uk/pages/feedback.php

    and not this link as I would expect: http://www.eastanglianentertainments.co.uk/pages/index.html

    Here is the script for the new test webpage (eae_contact3.html), it couldn't be simpler:

    form test name 1 2 3
    message