Jump to content

Recommended Posts

I want all the data I put onto the form to print into my back-end SQL database.

This is the code I have used:

<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY bgColor=#99ccff>
<DIV><B>GSI Insurance LTD</B> (Customer Contact Page)</DIV>
<HR>
<STYLE>.req {
COLOR: #ff0033
}
</STYLE>

<?

if ($_POST) {

  $msg = "";

  foreach($_POST as $k => $v) {
        $v = trim($v);
        $$k = $v;

        if ($v=="") {
          $msg = "Please fill in all fields";
        }
  }

  if ($msg=="") {
      $insert = "INSERT INTO claim_history, insurance_cover_type, licence,
        policy_holder, vehicle
        (title, first_name, surname, first_name, date_of_birth,
        uk_residency, marital_status, disability, employment_status,
        address_line_1, area, town, county, post_code, daytime_tel_no,
        evening_tel_no, email_address, manufacturer, model, reg_no, year_purchased, current_value,
        seats_incl_driver, cubic_capacity, annual_mileage, registered_owner,
        if_not_register_owner_please_supply_name, overnight_vehicle_location,
        licensing_authority, cover_required, class_of_use, type_of_bonus, policy_start_date,
        current_previous_insurer, current_previous_insurance_broker,
        target_premium, who_quoted, claim_1_date, claim_1_fault, claim_1_type,
        claim_1_repair_cost, claim_1_effect_on_NCB, claim_2_date, claim_2_fault,
        claim_2_type, claim_2_repair_cost, claim_2_effect_on_NCB, licence_type,
        years_held, additional_driver_name_1,addition_driver_1_licence_type,
        additional_driver_1_years_held)
        VALUES ('$t', '$fn', '$sn', '$fn', '$dob', '$uk', '$ms', '$d', '$es',
        '$ad1', '$a', '$tn', '$c', '$pc', '$dtn', '$etn', '$ee', '$m', '$mod', '$reg', '$yrp',
        '$cv', '$seats', '$cc', '$am', '$ro', '$notro', '$ovl', '$la', '$cr', '$class', '$tob',
        '$psd', '$cpi', $cpib', '$tp', '$wq', '$cd1', '$cf1', '$ct1', '$crc1',
        '$ncb1', '$cd2', '$cf2', '$ct2', '$crc2', '$ncb2', '$lt', '$yh', '$adn1',
        '$ad1', '$adlt1', '$adyh1')";

        include 'includes/db_conn.txt';

        if (!mysqli_query($link, $insert)) {
          $msg = "Error inserting data";
        } else {
          $msg = "Record succesfully added";

        $t = $fn = $sn = $fn = $dob = $uk = $ms = $d = $es = $ad1 = $a = $tn =
        $c = $pc = $dtn = $etn = $ee = $m = $mod = $reg = $yrp = $cv = $seats = $cc = $am =
        $ro = $notro = $ovl = $la = $cr = $class = $tob = $psd = $cpi = $cpib = $tp = $wq = $cd1
        = $cf1 = $ct1 = $crc1 = $ncb1 = $cd2 = $cf2 = $ct2 = $crc2 = $ncb2 = $lt
        = $yh = $adn1 = $ad1 = $adlt1 = $adyh1 = "";
        }
        mysqli_close($link);
  }

echo "<div class=\"error\">$msg</div>";

} else {
  $t = $fn = $sn = $fn = $dob = $uk = $ms = $d = $es = $ad1 = $a = $tn =
  $c = $pc = $dtn = $etn = $ee = $m = $mod = $reg = $yrp = $cv = $seats = $cc = $am =
  $ro = $notro = $la = $ovl = $cr = $class = $tob = $psd = $cpi = $cpib = $tp = $wq = $cd1
  = $cf1 = $ct1 = $crc1 = $ncb1 = $cd2 = $cf2 = $ct2 = $crc2 = $ncb2 = $lt =
  $yh = $adn1 = $ad1 = $adlt1 = $adyh1 = "";
}
?>




<FORM METHOD="post" ACTION="<? echo $SERVER['localhost'] ?>">
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Personal Details Items in <SPAN class=req>red</SPAN> or
      marked with <SPAN class=req>*</SPAN> are required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Title *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="title" VALUE="<? echo $t ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=Mr>Mr</OPTION> <OPTION value=Mrs>Mrs</OPTION>
    <OPTION value=Miss>Miss</OPTION>
    <OPTION value=MS>MS</OPTION></SELECT>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>First Name *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="first_name" VALUE="<? echo $fn ?>"/><BR>
    </TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Last Name *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="surname" VALUE="<? echo $sn ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Other Names (or none) *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="first_name" VALUE="<? echo $fn ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Date Of Birth *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="date_of_birth" VALUE="<? echo $dob ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>UK Residency *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="uk_residency" VALUE="<? echo $uk ?>"/> <OPTION
        value="" selected>-- Please select --</OPTION>
        <OPTION value="From Birth">From Birth</OPTION>
        <OPTION value="1 to 5 Years">1 to 5 Years</OPTION>
        <OPTION value="5 to 10 Years">5 to 10 Years</OPTION>
        <OPTION value="10 or more Years">10 or more Years</OPTION></SELECT>
  <BR></TD></TR>     
 
  <TR>
    <TD class=req vAlign=top align=left>Marital Status *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="marital_status" VALUE="<? echo $ms ?>"/> <OPTION
        value="" selected>-- Please select --</OPTION>
        <OPTION value=Married>Married</OPTION>
        <OPTION value=Single>Single</OPTION></SELECT>
        <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Disability (or None) *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="disability" VALUE="<? echo $d ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Employment Status</TD>
    <TD vAlign=top align=left><SELECT size=1 name="employment_status" VALUE="<? echo $es ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
        <OPTION value="Self Employed">Self Employed</OPTION>
        <OPTION value=Government>Government</OPTION>
        <OPTION value=Other>Other</OPTION></SELECT>
      <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Address Line 1 *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="address_line_1" VALUE="<? echo $ad1 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Area *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="area" VALUE="<? echo $a ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Town *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="town" VALUE="<? echo $tn ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>County *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="county" VALUE="<? echo $c ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Post Code *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="post_code" VALUE="<? echo $pc ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Telephone Work *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="daytime_tel_no" VALUE="<? echo $dtn ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Telephone Home *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="evening_tel_no" VALUE="<? echo $etn ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Fax Number *</TD>
    <TD vAlign=top align=left><INPUT size=45 name=""> <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>E-Mail *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="email_address" VALUE="<? echo $ee ?>"/>
<BR></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Type of Vehicle - Items in <SPAN class=req>red</SPAN> or
      marked with <SPAN class=req>*</SPAN> are required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Vehicle Make *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="manufacturer" VALUE="<? echo $m ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Vehicle Model *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="model" VALUE="<? echo $mod ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Registration Number *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="reg_no" VALUE="<? echo $reg ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Year Vehicle Registered *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="year_purchased" VALUE="<? echo $yrp?>"/>
    <OPTION value="<? echo $yrp?>" selected>-- Please select --</OPTION>
        <OPTION value=1980>1980</OPTION> <OPTION value=1981>1981</OPTION>
        <OPTION value=1982>1982</OPTION> <OPTION value=1983>1983</OPTION>
        <OPTION value=1984>1984</OPTION> <OPTION value=1985>1985</OPTION>
        <OPTION value=1986>1986</OPTION> <OPTION value=1987>1987</OPTION>
        <OPTION value=1988>1988</OPTION> <OPTION value=1989>1989</OPTION>
        <OPTION value=1990>1990</OPTION> <OPTION value=1991>1991</OPTION>
        <OPTION value=1992>1992</OPTION> <OPTION value=1993>1993</OPTION>
        <OPTION value=1994>1994</OPTION> <OPTION value=1995>1995</OPTION>
        <OPTION value=1996>1996</OPTION> <OPTION value=1997>1997</OPTION>
        <OPTION value=1998>1998</OPTION> <OPTION value=1999>1999</OPTION>
        <OPTION value=2000>2000</OPTION> <OPTION value=2001>2001</OPTION>
        <OPTION value=2002>2002</OPTION> <OPTION value=2003>2003</OPTION>
        <OPTION value=2004>2004</OPTION> <OPTION value=2005>2005</OPTION>
        <OPTION value=2006>2006</OPTION>
        <OPTION value="Another Year">Another Year</OPTION></SELECT>
        <BR></TD></TR>

  <TR>
    <TD vAlign=top align=left>Registration Year if not in 1980 to 2006</TD>
    <TD vAlign=top align=left><INPUT size=45 name=""> <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Vehicle Value *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="current_value" VALUE="<? echo $cv ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Seats (including driver) *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="seats_incl_driver" VALUE="<? echo $seats ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Engine Size *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="cubic_capacity" VALUE="<? echo $cc ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Annual Mileage *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="annual_mileage" VALUE="<? echo $am ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Registered Owner *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="registered_owner" VALUE="<? echo $ro ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=Policy Owner>Policy Owner</OPTION>
    <OPTION value=Other>Other</OPTION></SELECT>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>If not registered owner please say who is</TD>
    <TD vAlign=top align=left><TEXTAREA name= "if_not_registered_owner_please_supply_name" rows=10 cols=50 VALUE="<? echo $notro ?>"/>
    </TEXTAREA> </TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Overnight Vehicle Location *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="overnight_vehicle_location" VALUE="<? echo $ovl ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value="Garage">Garage</OPTION>
    <OPTION value="On the Road">On the Road</OPTION>
    </SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Electronic Immobiliser</TD>
    <TD vAlign=top align=left><SELECT size=1 name="" VALUE=""> <OPTION
        value="" selected>-- Please select --</OPTION> <OPTION
        value=Yes>Yes</OPTION> <OPTION value=No>No</OPTION></SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Tracking Device Fitted</TD>
    <TD vAlign=top align=left><SELECT size=1 name=F32 VALUE=""> <OPTION
        value="" selected>-- Please select --</OPTION> <OPTION
        value=Yes>Yes</OPTION> <OPTION value=No>No</OPTION></SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>If vehicle 'plated' - Which Council</TD>
    <TD vAlign=top align=left><SELECT size=1 name="licensing_authority" VALUE="<? echo $la ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value="Licensing Authority 1">Licensing Authority 1</OPTION>
    <OPTION value="Licensing Authority 2">Licensing Authority 2</OPTION>
    <OPTION value="Licensing Authority 3">Licensing Authority 3</OPTION>
    </SELECT><BR></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Type of Insurance - Items in <SPAN class=req>red</SPAN>
      or marked with <SPAN class=req>*</SPAN> are required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Type of Cover Required *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="cover_required" VALUE="<? echo $cr ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value="Comprehensive">Comprehensive</OPTION>
    <OPTION value="Third Party Fire and Theft">Third Party Fire and Theft</OPTION>
    <OPTION value="Third Party Only">Third Party Only</OPTION></SELECT>
  <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Class of Use *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="class_of_use" VALUE="<? echo $class ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value="Schools">Schools</OPTION>
    <OPTION value="SDP">SDP</OPTION>
    <OPTION value="Private Hire">Private Hire</OPTION>
    <OPTION value="Public Hire">Public Hire</OPTION></SELECT>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Taxi No Claims Bonus *</TD>
    <TD vAlign=top align=left><SELECT size=1 name="type_of_bonus" VALUE="<? echo $tob ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=None>None</OPTION> <OPTION value=1>1</OPTION>
    <OPTION value=2>2</OPTION> <OPTION value=3>3</OPTION>
    <OPTION value=4>4</OPTION> <OPTION value=5>5</OPTION>
    <OPTION value=6>6</OPTION> <OPTION value=Maximam>Maximam</OPTION>
    <OPTION value="Not Applicable">Not Applicable</OPTION></SELECT>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Cover Start Date *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="policy_start_date" VALUE="<? echo $psd ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Previous Insurers</TD>
    <TD vAlign=top align=left><INPUT size=45 name="current_previous_insurer" VALUE="<? echo $cpi ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Previous Brokers</TD>
    <TD vAlign=top align=left><INPUT size=45 name="current_previous_insurance_broker" VALUE="<? echo $cpib ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Target Premium</TD>
    <TD vAlign=top align=left><INPUT size=45 name="target_premium" VALUE="<? echo $tp ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Quoted By</TD>
    <TD vAlign=top align=left><INPUT size=45 name="who_quoted" VALUE="<? echo $wq ?>"/>
    <BR></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Previous Claims(first) - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD vAlign=top align=left>Claim 1 Details</TD>
    <TD vAlign=top align=left><INPUT size=45 name="">
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Date of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_1_date" VALUE="<? echo $cd1 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Type of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name=""> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Fault Claim</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_1_fault" VALUE="<? echo $cf1 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION>
    </SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Repair Cost</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_1_repair_cost" VALUE="<? echo $crc1 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Bonus Affected</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_1_effect_on_NCB" VALUE="<? echo $ncb1 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION>
    </SELECT> <BR></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Previous Claims(second) - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD vAlign=top align=left>Claim 2 Details</TD>
    <TD vAlign=top align=left><INPUT size=45 name=""> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Date of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_2_date" VALUE="<? echo $cd2 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Type of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_2_type" VALUE="<? echo $ct2 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Fault Claim</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_2_fault" VALUE="<? echo $cf2 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION>
    </SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Repair Cost</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_2_repair_cost" VALUE="<? echo $crc2 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Bonus Affected</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_2_effect_on_NCB" VALUE="<? echo $ncb2 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION></SELECT>
    <BR></TD></TR></TBODY></TABLE>   

<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>License details main driver - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD vAlign=top align=left>Policy Holder License Type for main driver</TD>
    <TD vAlign=top align=left><SELECT size=1 name="licence_type" VALUE="<? echo $lt ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value="UK Full">UK Full</OPTION>
    <OPTION value=Provisional>Provisional</OPTION></SELECT>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Years License Held</TD>
    <TD vAlign=top align=left><SELECT size=1 name="years_held" VALUE="<? echo $yh ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=1>1</OPTION> <OPTION value=2>2</OPTION>
    <OPTION value=3>3</OPTION> <OPTION value=4>4</OPTION>
    <OPTION value=5>5</OPTION> <OPTION value=6>6</OPTION>
    <OPTION value=7>7</OPTION> <OPTION value=8>8</OPTION>
    <OPTION value=9>9</OPTION> <OPTION value=10>10</OPTION>
    <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION>
    <OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION>
    <OPTION value=5>15</OPTION> <OPTION value=16>16</OPTION>
    <OPTION value=17>17</OPTION> <OPTION value=18>18</OPTION>
    <OPTION value=19>19</OPTION> <OPTION value=20>20</OPTION>
    <OPTION value="Greater than 20">Greater than 20</OPTION>
    <OPTION value="Less than 1">Less than 1</OPTION></SELECT>
    <BR></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>License details additional driver 1 - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Name of additional driver 1 (or none)
    *</TD>
    <TD vAlign=top align=left><INPUT size=45 name="additional_driver_1_name" VALUE="<? echo $ad1 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Date Of Birth of additional driver 1
      (or none) *</TD>
    <TD vAlign=top align=left><INPUT size=45 name=F57> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Policy Holder License Type for additional driver
      1</TD>
    <TD vAlign=top align=left><SELECT size=1 name=F58 VALUE=""> <OPTION
        value="" selected>-- Please select --</OPTION> <OPTION
        value="UK Full">UK Full</OPTION> <OPTION
        value=Provisional>Provisional</OPTION></SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Years License Held</TD>
    <TD vAlign=top align=left><SELECT size=1 name="additional_driver_1_licence_years_held" VALUE="<? echo $adyh1 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=1>1</OPTION> <OPTION value=2>2</OPTION>
    <OPTION value=3>3</OPTION> <OPTION value=4>4</OPTION>
    <OPTION value=5>5</OPTION> <OPTION value=6>6</OPTION>
    <OPTION value=7>7</OPTION> <OPTION value=8>8</OPTION>
    <OPTION value=9>9</OPTION> <OPTION value=10>10</OPTION>
    <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION>
    <OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION>
    <OPTION value=5>15</OPTION> <OPTION value=16>16</OPTION>
    <OPTION value=17>17</OPTION> <OPTION value=18>18</OPTION>
    <OPTION value=19>19</OPTION> <OPTION value=20>20</OPTION>
    <OPTION value="Greater than 20">Greater than 20</OPTION>
    <OPTION value="Less than 1">Less than 1</OPTION></SELECT>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Convictions over last three years</TD>
    <TD vAlign=top align=left><TEXTAREA name=F60 rows=10 cols=50 VALUE=""></TEXTAREA>
  </TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>License details additional driver 2 - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Name of additional driver 2 (or NONE)
    *</TD>
    <TD vAlign=top align=left><INPUT size=45 name=F61> <BR></TD></TR>
  <TR>
    <TD class=req vAlign=top align=left>Date Of Birth of additional driver 2
      (or none) *</TD>
    <TD vAlign=top align=left><INPUT size=45 name=F62> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Policy Holder License Type for additional driver
      2</TD>
    <TD vAlign=top align=left><SELECT size=1 name=F63 VALUE=""> <OPTION
        value="" selected>-- Please select --</OPTION> <OPTION
        value="UK Full">UK Full</OPTION> <OPTION
        value=Provisional>Provisional</OPTION></SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Years License Held</TD>
    <TD vAlign=top align=left><SELECT size=1 name=F64 VALUE=""> <OPTION
        value="" selected>-- Please select --</OPTION> <OPTION
        value=1>1</OPTION> <OPTION value=2>2</OPTION> <OPTION value=3>3</OPTION>
        <OPTION value=4>4</OPTION> <OPTION value=5>5</OPTION> <OPTION
        value=6>6</OPTION> <OPTION value=7>7</OPTION> <OPTION value=8>8</OPTION>
        <OPTION value=9>9</OPTION> <OPTION value=10>10</OPTION> <OPTION
        value=11>11</OPTION> <OPTION value=12>12</OPTION> <OPTION
        value=13>13</OPTION> <OPTION value=14>14</OPTION> <OPTION
        value=5>15</OPTION> <OPTION value=16>16</OPTION> <OPTION
        value=17>17</OPTION> <OPTION value=18>18</OPTION> <OPTION
        value=19>19</OPTION> <OPTION value=20>20</OPTION> <OPTION
        value="Greater than 20">Greater than 20</OPTION> <OPTION
        value="Less than 1">Less than 1</OPTION></SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Convictions over last three years</TD>
    <TD vAlign=top align=left><TEXTAREA name=F65 rows=10 cols=50 VALUE=""></TEXTAREA>
  </TD></TR></TBODY></TABLE>
<P><INPUT type=submit value="Submit Request" name=""> <INPUT type=reset value="Cancel"> </P></FORM>
<HR>

When I submit the page it comes up with this message:

You are not authorized to view this page
You might not have permission to view this directory or page using the credentials you supplied.

--------------------------------------------------------------------------------

If you believe you should be able to view this directory or page, please try to contact the Web site by using any e-mail address or phone number that may be listed on the localhost home page.

You can click  Search to look for information on the Internet.




HTTP Error 403 - Forbidden
Internet Explorer 

Can anybody help?

Link to comment
https://forums.phpfreaks.com/topic/15624-submit-form/
Share on other sites

I have now changed it to this:

<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY bgColor=#99ccff>
<DIV><B>GSI Insurance LTD</B> (Claim History Page)</DIV>
<HR>
<STYLE>.req {
COLOR: #ff0033
}
</STYLE>

<?

if ($_POST) {

  $msg = "";

  foreach($_POST as $k => $v) {
        $v = trim($v);
        $$k = $v;

        if ($v=="") {
          $msg = "Please fill in all fields";
        }
  }

  if ($msg=="") {
      $insert = "INSERT INTO claim_history
        (claim_1_date, claim_1_fault, claim_1_type,
        claim_1_repair_cost, claim_1_effect_on_NCB, claim_2_date, claim_2_fault,
        claim_2_type, claim_2_repair_cost, claim_2_effect_on_NCB)
        VALUES ( '$cd1', '$cf1', '$ct1', '$crc1','$ncb1', '$cd2', '$cf2', '$ct2',
        '$crc2', '$ncb2')";

        include 'includes/db_conn.txt';
       
        if (!mysqli_query($link, $insert)) {
          $msg = "Error inserting data";
        } else {
          $msg = "Record succesfully added";

        $cd1= $cf1 = $ct1 = $crc1 = $ncb1 = $cd2 = $cf2 = $ct2 = $crc2 = $ncb2 = "";
        }
        mysqli_close($link);
  }     

echo "<div class=\"error\">$msg</div>";

} else {
      $cd1= $cf1 = $ct1 = $crc1 = $ncb1 = $cd2 = $cf2 = $ct2 = $crc2 = $ncb2 = "";
}
?>

<FORM METHOD="post" ACTION="<? echo $SERVER['PHP_SELF'] ?>">
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Personal Details Items in <SPAN class=req>red</SPAN> or
      marked with <SPAN class=req>*</SPAN> are required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
 
  <TD colSpan=2><B>Previous Claims(first) - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD vAlign=top align=left>Claim 1 Details</TD>
    <TD vAlign=top align=left><INPUT size=45 name="">
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Date of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_1_date" VALUE="<? echo $cd1 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Type of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name=""> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Fault Claim</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_1_fault" VALUE="<? echo $cf1 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION>
    </SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Repair Cost</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_1_repair_cost" VALUE="<? echo $crc1 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Bonus Affected</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_1_effect_on_NCB" VALUE="<? echo $ncb1 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION>
    </SELECT> <BR></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 border=0>
  <TBODY>
  <TR>
    <TD colSpan=2><B>Previous Claims(second) - Items in <SPAN
      class=req>red</SPAN> or marked with <SPAN class=req>*</SPAN> are
      required.</B></TD></TR>
  <TR>
    <TD colSpan=2>&nbsp;</TD></TR>
  <TR>
    <TD vAlign=top align=left>Claim 2 Details</TD>
    <TD vAlign=top align=left><INPUT size=45 name=""> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Date of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_2_date" VALUE="<? echo $cd2 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Type of Claim</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_2_type" VALUE="<? echo $ct2 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Fault Claim</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_2_fault" VALUE="<? echo $cf2 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION>
    </SELECT> <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Repair Cost</TD>
    <TD vAlign=top align=left><INPUT size=45 name="claim_2_repair_cost" VALUE="<? echo $crc2 ?>"/>
    <BR></TD></TR>
  <TR>
    <TD vAlign=top align=left>Bonus Affected</TD>
    <TD vAlign=top align=left><SELECT size=1 name="claim_2_effect_on_NCB" VALUE="<? echo $ncb2 ?>"/>
    <OPTION value="" selected>-- Please select --</OPTION>
    <OPTION value=No>No</OPTION> <OPTION value=Yes>Yes</OPTION></SELECT>
    <BR></TD></TR></TBODY></TABLE>   
   
    <P><INPUT type=submit value="Submit Request" name=""> <INPUT type=reset value="Cancel"> </P></FORM>

But I still have the same problem saying:

'You are not authorized to view this page
You might not have permission to view this directory or page using the credentials you supplied.

--------------------------------------------------------------------------------

If you believe you should be able to view this directory or page, please try to contact the Web site by using any e-mail address or phone number that may be listed on the localhost home page.

You can click  Search to look for information on the Internet.




HTTP Error 403 - Forbidden
Internet Explorer '
Link to comment
https://forums.phpfreaks.com/topic/15624-submit-form/#findComment-66005
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.