PDA

View Full Version : HELP!!! Form not working right


Tomcat104
07-14-2011, 06:53 PM
I have just created my first form in Dreamweaver CS5 and I can't get it to work. I have sought the advice of MAYBE too many online tutorials so I'm turning to you guys for help. Following is the code I used and if someone can point out where I went wrong I'll change it again. The form seems to be set but when I press the "Submit" button I get a message that pops up telling me to download the PHP file that I have just downloaded.

<form id="ContactForm" name="ContactForm" method="post" action="FormToEmail.php">
<table width="551" border="0" align="left" cellpadding="4" id="contact">
<tr>
<td width="198" bgcolor="#FFFFFF">Full Name:</td>
<td width="284" bgcolor="#FFFFFF"><input name="fullname" type="text" id="fullname2" size="45" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Email Address:</td>
<td bgcolor="#FFFFFF"><input name="email" type="text" id="email" size="45" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Home Phone:</td>
<td bgcolor="#FFFFFF"><input name="homephone" type="text" id="homephone" size="21" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Cell Phone:</td>
<td bgcolor="#FFFFFF"><input type="text" name="cellphone" id="cellphone" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>PROPERTY INFORMATION</strong></td>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Address:</td>
<td bgcolor="#FFFFFF"><input name="address" type="text" id="address" size="40" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">City:</td>
<td bgcolor="#FFFFFF"><input type="text" name="city" id="city" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">State:</td>
<td bgcolor="#FFFFFF"><img src="../images/2x2.gif" width="2" height="2" />
<select name="state" id="state">
<option value="NC" selected="selected">NC</option>
<option value="SC">SC</option>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Zip Code:</td>
<td><input type="text" name="zip" id="zip" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Approximate Sq. Feet</td>
<td bgcolor="#FFFFFF"><input type="text" name="sqfeet" id="sqfeet" /></td>
</tr>
</table>
<p>
<label for="fullname"></label>
<label for="fullname2"></label>
</p>
<p>Comments:
<label for="comments"></label>
<textarea name="comments" id="comments" cols="55" rows="5"></textarea>
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" />
<input type="reset" name="reset" id="reset" value="Reset" />
<br />
</p>
</form>

gentleone
07-14-2011, 08:02 PM
most of the time this is a sign that you don't have PHP on your web server. Check this with your host.

Tomcat104
07-14-2011, 08:43 PM
I uploaded the FormToEmail.PHP file to my server. Should I have uploaded something else or ask my host to upload something? As I said I'm new again to Dreamweaver and have never done a form before.

gentleone
07-14-2011, 08:47 PM
In order to work with PHP files there must be PHP installed on your server. You can check it with your host or check it yourself with a phpinfo.php file.
See this topic for that:
http://docs.simplemachines.org/index.php?topic=479.0

Corrosive
07-15-2011, 08:04 AM
Also make sure your pages have the .php file extension or use .htaccess to handle .html as .php http://www.desilva.biz/php/phpinhtml.html

Corrosive
07-15-2011, 08:05 AM
Moved to PHP board.