Jump to content

linking html form with php


gram2410

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.