Jump to content

browser downloading php file as a document rather than running the script


JLF

Recommended Posts

Please help...

 

I have made a form that has

 

method="post" action="sendmail2.php" in my form tag. I placed the file sendmail2.php on the server and when I click the submit button, the browser tries to download the file sendmail.php rather than running the script...

 

All I would like is for the form to send an email with the information submitted...I don't know what I am missing...any suggestions?

 

Here is my script and html...

 

<form name="quotes" method="post" action="sendmail2.php" onSubmit="return validateForm(quotes);">

<table width="400" border="0">

<tr>

<td colspan="4" style="text-align: center"><b>Enter your information to receive

A FREE QUOTE</b></td>

</tr>

 

<tr>

<td style="text-align: right">

<label for="fname" class="fmlabel">First Name</label></td>

<td><input type="text" name="fname" /></td>

</tr>

<tr>

<td style="text-align: right"><label for="lname" class="fmlabel">Last Name</label></td>

<td><input type="text" name="lname" /></td>

</tr>

 

<tr>

<td valign="top" style="text-align: right"><label for="phone" class="fmlabel">Phone</label></td>

<td valign="top" colspan="3"><input type="text" name="phone" /></td>

</tr>

etc....

 

and my php file...

 

<?php

 

  $fname = $_POST['fname'] ;

  $lname = $_POST['lname'] ;

  $phone = $_POST['phone'] ;

  $email = $_POST['email'] ;

  $proj = $_POST['proj'] ;

 

  $quantity = $_POST['quantity'] ;

  $yesno = $_POST['yesno'] ;

  $required = $_POST['required'] ;

  $size = $_POST['size'] ;

  $shirtcolors = $_POST['shirtcolors'] ;

  $inkcolors = $_POST['inkcolors'] ;

  $date = $_POST['date'] ;

  $comments = $_POST['comments'] ;

 

$to = "[email protected]";

$subject = "Quote Request";

$message = "Customer Comments: $comments\n\n Project Name: $proj\n First Name: $fname\n Last Name: $lname\n

Email: $email\n Phone Number: $phone\nQuantity: $quantity\n Artwork Supplied: $yesno\n Artwork Required: $required\n

Size: $size\n Shirt Colours: $shirtcolors\n Ink Colours: $inkcolors\n Date Required: $date";

$from = "From:$email";

 

 

mail($to, $subject, $message, $from);

 

header( "Location: http://www.Lonestarsilkscreen.com/thankyou.html");

?>

 

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.