Jump to content

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 = "admin@chicunique.ca";

$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"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.