JLF Posted April 30, 2007 Share Posted April 30, 2007 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"); ?> Link to comment https://forums.phpfreaks.com/topic/49260-browser-downloading-php-file-as-a-document-rather-than-running-the-script/ Share on other sites More sharing options...
trq Posted April 30, 2007 Share Posted April 30, 2007 Seems you have not configured your server/php properly. Is this a local server? What steps did you take to install php and a web server? If its a hosted account, are you sure php is enabled? Link to comment https://forums.phpfreaks.com/topic/49260-browser-downloading-php-file-as-a-document-rather-than-running-the-script/#findComment-241348 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.