Guest carlvernon Posted November 26, 2005 Share Posted November 26, 2005 i am trying to write my website so that a user enters details in a html form on one page and posts it to another page which is written in php, when i try to test this i can enter the details but when i click the submit button it asks me to download or open the php file, and it wont open the page to show the forms data from the html page. Is this just because i dont have php installed correctly on my pc or is it likly to be a code error, here is the codehtml form page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Online T-Shirt Design & Payment System</title></head><body><h4>T-Shirt Design Form</h4><p> </p><form action="process.php" method="post"> <p> <label>T-Shirt Colour <select name="tshirtcolour"> <option>Red</option> <option>Green</option> <option>Blue</option> </select> </label> </p> <p> <label>Font <select name="font"> <option>Ariel</option> <option>Comic Sans Serif</option> <option>Times New Roman</option> </select> </label> </p> <p> <label>Font Colour <select name="fontcolour"> <option>Red</option> <option>Green</option> <option>Blue</option> </select> </label> </p> <p> </p> <h4><label>Please select a T-Shirt style</label></h4></p> <p><label> Style A</label> <img src="round neck.jpg" alt="style 1" width="105" height="85" /></p> <p><label> Style B</label> <img src="v neck small.jpg" alt="style 2" width="105" height="73" /></p> <p><label> Style C</label> <img src="style 3.jpg" alt="style 3" width="105" height="73" /></p> <p> <label>Choose 1 of the style as shown above <select name="shirt style"> <option>Style A</option> <option>Style B</option> <option>Style C</option> </select> </label> </p></form><p> </p></body></html> php page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Online T-Shirt Design & Payment System</title></head><body><?php$tshirtcolour = $_POST['tshirtcolour'];$font = $_POST['font'];$fontcolour = $_POST['fontcolour'];$shirtstyle = $_POST['shirtstyle'];echo "You ordered ". $tshirtcolour . " " . $font . " " . $fontcolour . " " . $shirtstyle . ".<br />";echo "Thank you for ordering";?></body></html> Link to comment Share on other sites More sharing options...
Guest madhuhari Posted November 28, 2005 Share Posted November 28, 2005 i am trying to write my website so that a user enters details in a html form on one page and posts it to another page which is written in php, when i try to test this i can enter the details but when i click the submit button it asks me to download or open the php file, and it wont open the page to show the forms data from the html page. Is this just because i dont have php installed correctly on my pc or is it likly to be a code error, here is the codehtml form page<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Online T-Shirt Design & Payment System</title></head><body><h4>T-Shirt Design Form</h4><p> </p><form action="process.php" method="post"> <p> <label>T-Shirt Colour <select name="tshirtcolour"> <option>Red</option> <option>Green</option> <option>Blue</option> </select> </label> </p> <p> <label>Font <select name="font"> <option>Ariel</option> <option>Comic Sans Serif</option> <option>Times New Roman</option> </select> </label> </p> <p> <label>Font Colour <select name="fontcolour"> <option>Red</option> <option>Green</option> <option>Blue</option> </select> </label> </p> <p> </p> <h4><label>Please select a T-Shirt style</label></h4></p> <p><label> Style A</label> <img src="round neck.jpg" alt="style 1" width="105" height="85" /></p> <p><label> Style B</label> <img src="v neck small.jpg" alt="style 2" width="105" height="73" /></p> <p><label> Style C</label> <img src="style 3.jpg" alt="style 3" width="105" height="73" /></p> <p> <label>Choose 1 of the style as shown above <select name="shirt style"> <option>Style A</option> <option>Style B</option> <option>Style C</option> </select> </label> </p></form><p> </p></body></html> php page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Online T-Shirt Design & Payment System</title></head><body><?php$tshirtcolour = $_GET['tshirtcolour'];$font = $_GET['font'];$fontcolour = $_GET['fontcolour'];$shirtstyle = $_GET['shirtstyle'];echo "You ordered ". $tshirtcolour . " " . $font . " " . $fontcolour . " " . $shirtstyle . ".<br />";echo "Thank you for ordering";?></body></html> <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
MadPotato Posted November 28, 2005 Share Posted November 28, 2005 dont your forgot the <input type="submit"> ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now