gram2410 Posted May 29, 2007 Share Posted May 29, 2007 hi, new to site and to php. been assigned a project and cant complete. every time i try to run the form i keep getting php functions appearing on the site. within my coding these functions are at the bottom but these shouldnt be displayed. can anyone help? thanks ??? Quote Link to comment https://forums.phpfreaks.com/topic/53455-linking-html-form-with-php/ Share on other sites More sharing options...
per1os Posted May 29, 2007 Share Posted May 29, 2007 It may help if you provide us with some code and point out where the errors occur ??? Quote Link to comment https://forums.phpfreaks.com/topic/53455-linking-html-form-with-php/#findComment-264168 Share on other sites More sharing options...
gram2410 Posted May 29, 2007 Author Share Posted May 29, 2007 the form html code is as follows: <html> <head> <TITLE>Form</TITLE> </HEAD> <link rel="stylesheet" type="text/css" href="styles.css" > <?php function HTML_Head() { echo " } function HTML_Form() { echo " <form action ="DataAccess3.php" method="post"> <p>Please enter your details in order to be covered today.<p> Prices range from £3.99 a month up to £9.99 dependant of cover.</bold><br> <p> <table> Full Name:<input name=\"CustomerName\" TYPE=\"text\" SIZE=\"25\"><br> Phone Number:<input =\"CustomersPhonenumber\" TYPE=\"text\" SIZE=\"11\"><br> Address: <input name=\"CustomerAddress\" TYPE=\"text\" SIZE=\"35\"><br> Bank Account No: <input name=\"BankAccountNo\" TYPE=\"text\" SIZE=\"10\"><br> Sort code: <input name=\"SortCode\" TYPE=\"text\" SIZE=\"8\"><br> Bank Name: <input name=\"BankName\" TYPE=\"text\" SIZE=\"35\"><br> Phone Make: <input name=\"PhoneManufacturer\" TYPE=\"text\" SIZE=\"15\"><br> Phone Model: <input name=\"PhoneModel\" TYPE=\"text\" SIZE=\"10\"><br> IMEI Number: <input name=\"IMEA\" TYPE=\"text\" SIZE=\"15\"><br> Policy Type:<select name="policy type"> <option value="Bronze">Bronze</option> <option value="Silver">Silver</option> <option value="Gold" selected="selected">Gold</option> </select><br> <input type="Submit" /> </form> </table> "; } function HTML_Existing() { echo "Existing database entries"; } function HTML_Foot() { echo "</body></html>"; ?> </body> </html> sorry, as i say new to this!! the error on the page is coming up after the submit button on the code. thanks Quote Link to comment https://forums.phpfreaks.com/topic/53455-linking-html-form-with-php/#findComment-264174 Share on other sites More sharing options...
per1os Posted May 29, 2007 Share Posted May 29, 2007 html> <head> <TITLE>Form</TITLE> </HEAD> <link rel="stylesheet" type="text/css" href="styles.css" > <?php function HTML_Head() { echo ""; // parse error here now fixed. } function HTML_Form() { // remember to escape ALL " not just a few. echo " <form action=\"DataAccess3.php\" method=\"post\"> <p>Please enter your details in order to be covered today.<p> Prices range from £3.99 a month up to £9.99 dependant of cover.</bold> <p> <table> Full Name:<input name=\"CustomerName\" TYPE=\"text\" SIZE=\"25\"> Phone Number:<input =\"CustomersPhonenumber\" TYPE=\"text\" SIZE=\"11\"> Address: <input name=\"CustomerAddress\" TYPE=\"text\" SIZE=\"35\"> Bank Account No: <input name=\"BankAccountNo\" TYPE=\"text\" SIZE=\"10\"> Sort code: <input name=\"SortCode\" TYPE=\"text\" SIZE=\"8\"> Bank Name: <input name=\"BankName\" TYPE=\"text\" SIZE=\"35\"> Phone Make: <input name=\"PhoneManufacturer\" TYPE=\"text\" SIZE=\"15\"> Phone Model: <input name=\"PhoneModel\" TYPE=\"text\" SIZE=\"10\"> IMEI Number: <input name=\"IMEA\" TYPE=\"text\" SIZE=\"15\"> Policy Type:<select name=\"policy type\"> <option value=\"Bronze\">Bronze</option> <option value=\"Silver\">Silver</option> <option value=\"Gold\" selected=\"selected\">Gold</option> </select> <input type=\"Submit\" /> </form> </table> "; } function HTML_Existing() { echo "Existing database entries"; } function HTML_Foot() { echo "</body></html>"; } // another parse error here without the closing } // although there is really no need for all the functions you put here // since this is the code you gave me here is how it would work: HTML_Head(); HTML_Form(); HTML_Existing(); HTML_Foot(); ?> A lot of syntax errors etc. I would suggest reading up on PHP syntax. Also the functions are not really necessary, but yea. Quote Link to comment https://forums.phpfreaks.com/topic/53455-linking-html-form-with-php/#findComment-264178 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.