Jump to content

PHP Contact Form mail script launching new page after sent


solarparadox

Recommended Posts

Hi. First time posting here. I'm relatively new to PHP, but I have a contact form that links to a PHP mail script for processing, and every time I submit the form, it launches a second webpage with the URL of the script, which gives a server error. I've spoken to the host and according to them there is no problem and he has no idea why that page is coming up.

 

PHP Script

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

$to = "[email protected]";

$body = "From: " . $name . " " . "\n" . "Message: " . $message;

$headers = "From: $email";
$subject = "Chic Unique Contact Form";

ini_set(smtp_port, 25) ;
ini_set("smpt", "smtp-out.promailbox.net");

mail($to,$subject,$body,$headers);
?>

 

HTML Form

<form id="form" method="post"  target=”_blank” action="scripts/mail.php" name="form" >
   <div class="inp_h">
     <input class="inp_2" type="text"  name="name" value="Name:"  onfocus="this.value=''" />
   </div>
    <div class="inp_h">
      <input class="inp_2" type="text"  name="mail" value="E-mail:"  onfocus="this.value=''" />
    </div>
      <div><textarea class="inp_3" rows="8" cols="40" name="message" onfocus="this.value=''">Message:</textarea></div>
       <div style="padding:12px 0 0 0;">
           <a href="#" onclick="document.getElementById('form').reset()"><img src="images/clear.gif" style="border:0px none;" alt="" /></a><img src="images/spacer.gif" alt="" width="6" height="1" /><a href="#" onclick="document.getElementById('form').submit()"><img src="images/submit.gif" style="border:0px none;" alt="" /></a><br />                                                                </div>
</form>

 

As you can see the PHP script is fairly simple, and I don't see any code that would launch a second window (I know some launch a thankyou page, etc). Any ideas on that would be greatful.

 

The web address is www.chicunique.ca, which is a work in progress but fairly well along.

 

Thanks for any help

I removed that portion of the code, but now rather than a separate page coming up, the current page goes to the script url "www.chicunique.ca/scripts/mail.php" <-what I see in the URL. And I still get a weird server error "500 - Internal Server Error"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.