Form won't submit - tries to save PHP file

Adobe Dreamweaver cs5 v.11.0
November 1, 2010 at 13:37:51
Specs: Windows Vista
I'm building a website and I've written a PHP script to power a quotation form, but it doesn't seem to be working. Could anyone please help?

I've built this form in dreamweaver and written a PHP email script to make it send to an email address, but when I click 'submit' on the form my browser opens a 'save or select program' dialog box asking what program I want to save / or run this PHP script with?. If I choose my browser, it keeps opening new pages until I force quit.

Here's the code from the PHP file, if that helps - thanks anyone and everyone!


/* Subject and email variables */

$emailSubject = 'Flair Website form order';
$webMaster = '';

/* Gathering data variables */

$companyname = $_POST{'comp_name'};
$contactname = $_POST{'contact_name'};
$emailaddress = $_POST{'email_address'};
$address = $_POST{'address'};
$postcode = $_POST{'postcode'};
$phonenumber = $_POST{'phone_number'};
$faxnumber = $_POST{'fax_number'};
$shipmenttype = $_POST{'shipment_details_imp_exp'};
$shipmentmode = $_POST{'shipment_mode'};
$deliveryoption = $_POST{'delivery_option'};
$numberpieces = $_POST{'number_pieces'};
$totalweight = $_POST{'total_weight'};
$dimensions = $_POST{'dimensions'};
$destinationcountry = $_POST{'destination_country'};
$cityzip = $_POST{'city_zip_postcode'};
$dimensions = $_POST{'dimensions'};
$origincountry = $_POST{'origin_country'};
$originpostcode = $_POST{'city_state_postcode_origin'};

$body = <<<EOD


Company name: $comp_name

Contact name: $contact_name

Email address: $email_address

Address: $address

Postcode: $postcode

Phone number: $phone_number

Fax number: $fax_number

Shipment mode: $shipment_details_imp_exp

Delivery option: $delivery_option

Number of pieces: $number_pieces

Total weight: $total_weight

Dimensions: $dimensions

Destination country: $destination_country

City / Zip / Postal Code: $city_zip_postcode

Origin country: $origin_country

City / Zip / Postal code: $city_state_postcode_origin


$headers = "From: $email_address\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webmaster, $emailsubject, $body, $headers);

/* Results rendered as HTML */

$theResults - <<<EOD
<title>Flair Forwarding UK ltd - we recieved your email</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;

<div align="left">Thank you for your interest! Your email will be answered very soon!</div>



See More: Form wont submit - tries to save PHP file

Report •

November 5, 2010 at 15:31:23
One quick inquiry:
Why is there a dash here and not an equals?
$theResults - <<<EOD

Anyways, unless you have installed PHP onto your personal computer, you will not be able to run any PHP files.

Since I don't want the PHP clutter taking up Hard drive space, I simply go to a free web hosting site that supports PHP/MySQL (I use 000webhost.)

Good Luck!

Report •
Related Solutions

Ask Question