php form validation

  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i have this validation but i dont know how to actually bring it into action. i had javascript validation but that doesnt help at all for a number of reasons.

1. ppl can turn the javascript off
2. the javascript interferred with my php and therefore nothing was passed.

what else needs to be done with thtis code in order for the validation tot ake full effect

PHP Code: [ Select ]
$required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
 
for($i=0;$i<count($required_fields);$i++) {
 
    if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
        $err[]='You must provide a '.$_POST[$required_fields[$i]];
 
    }
 
}
  1. $required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  2.  
  3. for($i=0;$i<count($required_fields);$i++) {
  4.  
  5.     if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  6.  
  7.         $err[]='You must provide a '.$_POST[$required_fields[$i]];
  8.  
  9.     }
  10.  
  11. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

PHP Code: [ Select ]
 
$errCount   = 0;
 
$fineCount  = 0;
 
$required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
 
for($i=0;$i<count($required_fields);$i++) {
 
    if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
        $err[$errCount]='You must provide a '.$required_fields[$i];// SORRY NASTY BUG FIX HERE! 28-06-2004
 
      $errCount   = $errCount + 1;
 
    }else{
 
      $field[$fineCount] = $_POST[$required_fields[$i]];
 
      $fineCount  = $fineCount + 1;
 
   }
 
}
 
if (count($err)>0) {
 
    //output error code
 
   $strOut = "Your submision generated the following errors:<br>";
 
   for ($i=0;$i<count($err);$i++){
 
      $strOut .= $err[$i] . "<br>";
 
   }
 
}else{
 
   //form completed take action
 
}
 
 
  1.  
  2. $errCount   = 0;
  3.  
  4. $fineCount  = 0;
  5.  
  6. $required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  7.  
  8. for($i=0;$i<count($required_fields);$i++) {
  9.  
  10.     if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  11.  
  12.         $err[$errCount]='You must provide a '.$required_fields[$i];// SORRY NASTY BUG FIX HERE! 28-06-2004
  13.  
  14.       $errCount   = $errCount + 1;
  15.  
  16.     }else{
  17.  
  18.       $field[$fineCount] = $_POST[$required_fields[$i]];
  19.  
  20.       $fineCount  = $fineCount + 1;
  21.  
  22.    }
  23.  
  24. }
  25.  
  26. if (count($err)>0) {
  27.  
  28.     //output error code
  29.  
  30.    $strOut = "Your submision generated the following errors:<br>";
  31.  
  32.    for ($i=0;$i<count($err);$i++){
  33.  
  34.       $strOut .= $err[$i] . "<br>";
  35.  
  36.    }
  37.  
  38. }else{
  39.  
  40.    //form completed take action
  41.  
  42. }
  43.  
  44.  


dont'know if I understood the question correctly but here is the way I would proccess the validation.

//EDIT Note this validation doesn't do any type of data testing or validation, it merely decides if the field was empty or completed

Have you used PHP before?
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Hmm, looking at your example RabidDog, I think you meant to have:
PHP Code: [ Select ]
if (count($err)>0) {

be
PHP Code: [ Select ]
if (count($errCount)>0) {

correct me if I'm wrong but I think that is what you meant to put.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

No actually it wasn't wrong. the count function is to measure the size of an array.

It can be done the way you suggest, but it would look a bit different

PHP Code: [ Select ]
 
if ($errCount>0) {
 
 
  1.  
  2. if ($errCount>0) {
  3.  
  4.  


no need to call the count function
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i am after a validation php script for my form. i have a number of required fields. infact about 95% of my form fields are required. they are made up of checkboxes, radio buttons and text fields. i need a script that will allow me to list the required fields then have a validation on those required fields. i know what i want i just don't know how to write it. i dont want to use javascript validation purely because the javascript capabilities can be turned off. plus there are some other things that realy doesnt make javascript validation a strong and robust enough solution.

any help would be great.

because i have a number of fields that need validating (error message to be displayed if not filled in correctly) would i need to place it in an array?

anyway, help would be excellent
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Ok, I think this would work for you. All you have to do is replace all the messages and you'll be good.
PHP Code: [ Select ]
$errCount     = 0;
 
$fineCount    = 0;
 
$errMessage   = "";
 
$required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
 
$field_errors=array('Message','Message','Message','Message','Message','Message','Message','Message','Message','Message','Message','Message','Message');
 
for($i=0;$i<count($required_fields);$i++) {
 
    if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
        $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
 
        $errCount     = $errCount + 1;
 
        $errMessage   = "$errMessage $_POST[$required_fields[$i]]";
 
    }else{
 
        $field[$fineCount] = $_POST[$required_fields[$i]];
 
        $fineCount    = $fineCount + 1;
 
    }
 
}
 
if (count($err)>0) {
 
    //output error code
 
    $strOut = "Your submision generated the following errors:<br>";
 
    $errors = preg_split('/ /', $errMessage, -1);
 
    foreach($errors as $e) {
 
        echo $field_errors[$e] . "<br>";
 
    }
 
}else{
 
    //form completed take action
 
}
  1. $errCount     = 0;
  2.  
  3. $fineCount    = 0;
  4.  
  5. $errMessage   = "";
  6.  
  7. $required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  8.  
  9. $field_errors=array('Message','Message','Message','Message','Message','Message','Message','Message','Message','Message','Message','Message','Message');
  10.  
  11. for($i=0;$i<count($required_fields);$i++) {
  12.  
  13.     if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  14.  
  15.         $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
  16.  
  17.         $errCount     = $errCount + 1;
  18.  
  19.         $errMessage   = "$errMessage $_POST[$required_fields[$i]]";
  20.  
  21.     }else{
  22.  
  23.         $field[$fineCount] = $_POST[$required_fields[$i]];
  24.  
  25.         $fineCount    = $fineCount + 1;
  26.  
  27.     }
  28.  
  29. }
  30.  
  31. if (count($err)>0) {
  32.  
  33.     //output error code
  34.  
  35.     $strOut = "Your submision generated the following errors:<br>";
  36.  
  37.     $errors = preg_split('/ /', $errMessage, -1);
  38.  
  39.     foreach($errors as $e) {
  40.  
  41.         echo $field_errors[$e] . "<br>";
  42.  
  43.     }
  44.  
  45. }else{
  46.  
  47.     //form completed take action
  48.  
  49. }

Hope it helps you out some.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

there seems to be something wrong with this line

PHP Code: [ Select ]
$errMessage   = "$errMessage $_POST[$required_fields[$i]]";


i get this message "Parse error: parse error, unexpected '[', expecting ']' in /path/to/databasename/getstartedform.php on line 42" i am not sure what the problem is but the error is constant.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

PHP Code: [ Select ]
 
if ($_POST['submit'])
 
{
 
$user="";
 
$host="";
 
$password="";
 
$database="";
 
$connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
 
$db=mysql_select_db($database,$connection);
 
$errCount     = 0;
 
$fineCount    = 0;
 
$errMessage   = "";
 
$required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
 
$field_errors=array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
 
for($i=0;$i<count($required_fields);$i++) {
 
    if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
        $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
 
        $errCount     = $errCount + 1;
 
        $errMessage   = "$errMessage $_POST[$required_fields[$i]]";
 
    }else{
 
        $field[$fineCount] = $_POST[$required_fields[$i]];
 
        $fineCount    = $fineCount + 1;
 
    }
 
}
 
if (count($err)>0) {
 
    //output error code
 
    $strOut = "Your submision generated the following errors:<br>";
 
    $errors = preg_split('/ /', $errMessage, -1);
 
    foreach($errors as $e) {
 
        echo $field_errors[$e] . "<br>";
 
    }
 
}else{  //start sql query
  1.  
  2. if ($_POST['submit'])
  3.  
  4. {
  5.  
  6. $user="";
  7.  
  8. $host="";
  9.  
  10. $password="";
  11.  
  12. $database="";
  13.  
  14. $connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
  15.  
  16. $db=mysql_select_db($database,$connection);
  17.  
  18. $errCount     = 0;
  19.  
  20. $fineCount    = 0;
  21.  
  22. $errMessage   = "";
  23.  
  24. $required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  25.  
  26. $field_errors=array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
  27.  
  28. for($i=0;$i<count($required_fields);$i++) {
  29.  
  30.     if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  31.  
  32.         $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
  33.  
  34.         $errCount     = $errCount + 1;
  35.  
  36.         $errMessage   = "$errMessage $_POST[$required_fields[$i]]";
  37.  
  38.     }else{
  39.  
  40.         $field[$fineCount] = $_POST[$required_fields[$i]];
  41.  
  42.         $fineCount    = $fineCount + 1;
  43.  
  44.     }
  45.  
  46. }
  47.  
  48. if (count($err)>0) {
  49.  
  50.     //output error code
  51.  
  52.     $strOut = "Your submision generated the following errors:<br>";
  53.  
  54.     $errors = preg_split('/ /', $errMessage, -1);
  55.  
  56.     foreach($errors as $e) {
  57.  
  58.         echo $field_errors[$e] . "<br>";
  59.  
  60.     }
  61.  
  62. }else{  //start sql query


i get an error at this line
PHP Code: [ Select ]
$errMessage   = "$errMessage $_POST[$required_fields[$i]]";
and i am not sure what to do about it. this is not a spam mail. i am just backing up my previous post.
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Yea sorry about that, I wasn't paying much attention when I made it. This should fix that problem.
PHP Code: [ Select ]
if ($_POST['submit'])
 
{
 
$user="";
 
$host="";
 
$password="";
 
$database="";
 
$connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
 
$db=mysql_select_db($database,$connection);
 
$errCount     = 0;
 
$fineCount    = 0;
 
$errMessage   = "";
 
$required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
 
$field_errors=array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
 
for($i=0;$i<count($required_fields);$i++) {
 
    if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
        $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
 
        $errCount     = $errCount + 1;
 
        $errMessage   = "$errMessage ".$_POST[$field_errors[$i]];
 
    }else{
 
        $field[$fineCount] = $_POST[$required_fields[$i]];
 
        $fineCount    = $fineCount + 1;
 
    }
 
}
 
if (count($err)>0) {
 
    //output error code
 
    $strOut = "Your submision generated the following errors:<br>";
 
    $errors = preg_split('/ /', $errMessage, -1);
 
    foreach($errors as $e) {
 
        echo $field_errors[$e] . "<br>";
 
    }
 
}else{  //start sql query
  1. if ($_POST['submit'])
  2.  
  3. {
  4.  
  5. $user="";
  6.  
  7. $host="";
  8.  
  9. $password="";
  10.  
  11. $database="";
  12.  
  13. $connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
  14.  
  15. $db=mysql_select_db($database,$connection);
  16.  
  17. $errCount     = 0;
  18.  
  19. $fineCount    = 0;
  20.  
  21. $errMessage   = "";
  22.  
  23. $required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  24.  
  25. $field_errors=array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
  26.  
  27. for($i=0;$i<count($required_fields);$i++) {
  28.  
  29.     if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  30.  
  31.         $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
  32.  
  33.         $errCount     = $errCount + 1;
  34.  
  35.         $errMessage   = "$errMessage ".$_POST[$field_errors[$i]];
  36.  
  37.     }else{
  38.  
  39.         $field[$fineCount] = $_POST[$required_fields[$i]];
  40.  
  41.         $fineCount    = $fineCount + 1;
  42.  
  43.     }
  44.  
  45. }
  46.  
  47. if (count($err)>0) {
  48.  
  49.     //output error code
  50.  
  51.     $strOut = "Your submision generated the following errors:<br>";
  52.  
  53.     $errors = preg_split('/ /', $errMessage, -1);
  54.  
  55.     foreach($errors as $e) {
  56.  
  57.         echo $field_errors[$e] . "<br>";
  58.  
  59.     }
  60.  
  61. }else{  //start sql query
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

it doesnt work at all. thre must be something i am not doing. when i press the submit button the screen goes completely blank. refreshing doesnt make a difference either. when i take the validation out then the form works ok. a confirmation is sent and i am able to look at the details of what was inputted. once the validation is there then nothing happens. it was the same when i have javascript validation. the screen would go blank. its as if the validation is holding the page and refusing to actually do the validating and then move on.

http://www.buildingdoctors.co.uk/getstartedform.php is the file in question. fill it in or just press submit to see what i mean
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

Code: [ Select ]
<head>
<title>SIGN UP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<SCRIPT LANGUAGE="JavaScript">
<!--
function redirect () { setTimeout("go_now()",4000); }
function go_now ()  { window.location.href = "getstartedformtrial.php"; }
//-->
</SCRIPT>
</head>

<?php

if ($_POST['submit'])
{
$user="";
$host="localhost";
$password="";
$database="";
$connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
$db=mysql_select_db($database,$connection);
$errCount   = 0;
$fineCount  = 0;
$errMessage  = "";
$required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
$field_errors=array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
for($i=0;$i<count($required_fields);$i++) {
  if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
    $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
    $errCount   = $errCount + 1;
    $errMessage  = "$errMessage ".$_POST[$field_errors[$i]];
  }else{
    $field[$fineCount] = $_POST[$required_fields[$i]];
    $fineCount  = $fineCount + 1;
  }
}
if (count($err)>0) {
  //output error code
  $strOut = "Your submision generated the following errors:<br>";
  $errors = preg_split('/ /', $errMessage, -1);
  foreach($errors as $e) {
    echo $field_errors[$e] . "<br>";
  }
}else{
$sql = "insert into gstrialforma(name, email, contactaddress, mobile, workhometel, contactpostcode, projectpostcode, doyouneed, designstyle, project, uses, engineer, partywall, architect, projectmanager, design, lifestyle, structural, planning, buildingregs, otherhelp, wheelchair, partialeyesight, terraced, familychildern, semidetached, aged, allergy, detached, other, otherneeds, specifyneeds, programtimecompletion, budgetcost, projectdeadline, whybuild, otherpreferences) values ('{$_POST['name']}','{$_POST['email']}','{$_POST['contactaddress']}','{$_POST['mobile']}','{$_POST['workhometel']}','{$_POST['contactpostcode']}','{$_POST['projectpostcode']}','{$_POST['doyouneed']}','{$_POST['designstyle']}','{$_POST['project']}','{$_POST['uses']}','{$_POST['engineer']}','{$_POST['partywall']}','{$_POST['architect']}','{$_POST['projectmanager']}','{$_POST['design']}','{$_POST['lifestyle']}','{$_POST['structural']}','{$_POST['planning']}','{$_POST['buildingregs']}','{$_POST['otherhelp']}','{$_POST['wheelchair']}','{$_POST['partialeyesight']}','{$_POST['terraced']}','{$_POST['familychildern']}','{$_POST['semidetached']}','{$_POST['aged']}','{$_POST['allergy']}','{$_POST['detached']}','{$_POST['other']}','{$_POST['otherneeds']}','{$_POST['specifyneeds']}','{$_POST['programtimecompletion']}','{$_POST['budgetcost']}','{$_POST['projectdeadline']}','{$_POST['whybuild']}','{$_POST['otherpreferences']}')";
$result = mysql_query($sql) or print(mysql_error());
//mail($to, $subject, $msg, $additional_headers);
mail($_POST['email'],'hello there','Hello '.$_POST['name'].', thank you for filling out the form ', "From: athompson@building-doctors.com");
echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext><tr><td>";
echo 'Hello '.$_POST['name'].', thank you for filling out the form ';
echo "</tr></td></table>";
echo "<body onLoad=redirect() text=#000000 link=#00FFFF vlink=#C0C0C0>";
}
else
{
?>
<body leftmargin="0" topmargin="0">
<table width="400" height="246" border="0" cellpadding="0" cellspacing="0" class="biggertext">
 <tr>
  <td height="30" valign="top"><form method="POST" action="getstartedformtrial.php">
    <table width="400" border="0" cellspacing="0" cellpadding="4">
     <tr>
      <td align="center"><img src="images/cr_header.gif" width="404" height="55" /></td>
     </tr>
    </table>
    <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
     <tr bgcolor="#305A36">
      <td height="24" colspan="2" class="boldtext"><div align="center" class="stylewht">personal
        details </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td width="199">name:<br /> <input type="text" name="name" id="name" class="textstyle" /></td>
      <td width="199">email: <br /> <input type="text" name="email" id="email" class="textstyle"/></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td rowspan="2">contact address:
       <textarea name="contactaddress" cols="20" rows="2" id="contactaddress"></textarea></td>
      <td>mobile:<br /> <input name="mobile" type="text" class="textstyle" id="mobile"/></td>
     </tr>
     <tr>
      <td bgcolor="#F4FFF4">work/home tel:
       <input name="workhometel" type="text" class="textstyle" id="workhometel"/></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td>contact postcode:<br /> <input name="contactpostcode" type="text" class="textstyle" id="contactpostcode" /></td>
      <td bgcolor="#F4FFF4">project postcode: <br /> <input name="projectpostcode" type="text" class="textstyle" id="projectpostcode"/>
      </td>
     </tr>
    </table>
    <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
     <tr bgcolor="#F4FFF4">
      <td width="20%">do you need</td>
      <td width="26%"><div align="right">refurb
        <input type="radio" name="doyouneed" value="refurb" />
       </div></td>
      <td width="30%"><div align="right">extra space
        <input type="radio" name="doyouneed" value="extraspace" />
       </div></td>
      <td width="24%"><div align="right">extra light
        <input type="radio" name="doyouneed" value="extralight" />
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td>design style</td>
      <td><div align="right">contemp'ry
        <input type="radio" name="designstyle" value="contemporary" />
       </div></td>
      <td><div align="right">traditional
        <input type="radio" name="designstyle" value="traditional" />
       </div></td>
      <td><div align="right">mixed
        <input type="radio" name="designstyle" value="mixed" />
       </div></td>
     </tr>
    </table>
    <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
     <tr bgcolor="#F4FFF4">
      <td colspan="5">&nbsp;</td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td width="20%">project</td>
      <td width="19%"><div align="right">garden
        <input type="radio" name="project" value="garden" />
       </div></td>
      <td width="18%"><div align="right">loft
        <input type="radio" name="project" value="loft" />
       </div></td>
      <td width="17%"><div align="right">refit
        <input type="radio" name="project" value="refit" />
       </div></td>
      <td width="26%"><div align="right">extension
        <input type="radio" name="project" value="extension" />
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td>use</td>
      <td><div align="right">shop
        <input type="radio" name="uses" value="shop" />
       </div></td>
      <td><div align="right">office
        <input type="radio" name="uses" value="office" />
       </div></td>
      <td><div align="right">home
        <input type="radio" name="uses" value="home" />
       </div></td>
      <td><div align="right">other
        <input type="radio" name="uses" value="other" />
       </div></td>
     </tr>
    </table>
    <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
     <tr>
      <td height="24" colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">type
        of help required</div></td>
      <td colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">special
        needs</div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td width="22%" bordercolor="#FFFFFF"><div align="left">engineer</div></td>
      <td width="24%" bordercolor="#FFFFFF" bgcolor="#F4FFF4"> <div align="left">
        <input name="engineer" type="checkbox" class="textstyle" id="engineer" value="yes"/>
       </div></td>
      <td width="30%" bordercolor="#FFFFFF"><div align="left">Wheelchair
        ecology</div></td>
      <td width="24%" bordercolor="#FFFFFF"><div align="right">
        <input name="wheelchair" type="checkbox" class="textstyle" id="wheelchair" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">party wall</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="partywall" type="checkbox" class="textstyle" id="partywall2" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">Partial eyesight</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="partialeyesight" type="checkbox" class="textstyle" id="partialeyesight" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">architect</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="architect" type="checkbox" class="textstyle" id="architect" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">terraced</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="terraced" type="checkbox" class="textstyle" id="terraced" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td height="33" bordercolor="#FFFFFF"><div align="left">project manager</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="projectmanager" type="checkbox" class="textstyle" id="projectmanager" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">family &amp; <br />
        children</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="familychildern" type="checkbox" class="textstyle" id="familychildern" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">design</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="design" type="checkbox" class="textstyle" id="design" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">semi-detached</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="semidetached" type="checkbox" class="textstyle" id="semidetached" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">lifestyle</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="lifestyle" type="checkbox" class="textstyle" id="lifestyle" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">aged</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="aged" type="checkbox" class="textstyle" id="aged" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">structural</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="structural" type="checkbox" class="textstyle" id="structural" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">allergy</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="allergy" type="checkbox" class="textstyle" id="allergy" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">planning</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="planning" type="checkbox" class="textstyle" id="planning" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">detached</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="detached" type="checkbox" class="textstyle" id="detached" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">building regs</div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="buildingregs" type="checkbox" class="textstyle" id="buildingregs" value="yes"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">other</div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="otherneeds" type="checkbox" class="textstyle" id="otherneeds" value="yes"/>
       </div></td>
     </tr>
     <tr bgcolor="#F4FFF4">
      <td bordercolor="#FFFFFF"><div align="left">other </div></td>
      <td bordercolor="#FFFFFF"> <div align="left">
        <input name="otherhelp" type="text" class="textstyle" id="otherhelp" size="15"/>
       </div></td>
      <td bordercolor="#FFFFFF"><div align="left">please specify </div></td>
      <td bordercolor="#FFFFFF"><div align="right">
        <input name="specifyneeds" type="text" class="textstyle" id="specifyneeds" size="15"/>
       </div></td>
     </tr>
    </table>
    <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
     <tr bgcolor="#305A36">
      <td height="24" colspan="4" class="boldtext"><div align="center" class="stylewht">Customer
        Preferences</div></td>
     </tr>
     <tr>
      <td width="23%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>months</strong></div></td>
      <td width="24%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">1</div></td>
      <td width="30%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">6</div></td>
      <td width="22%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">9</div></td>
     </tr>
     <tr>
      <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">program
        time completion</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="programtimecompletion" value="1month" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="programtimecompletion" value="6months" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="programtimecompletion" value="9months" />
       </div></td>
     </tr>
     <tr>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>k=1000</strong></div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">3k
        - 15k</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">18k
        - 45k</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">&nbsp;
        &gt; 50k</div></td>
     </tr>
     <tr>
      <td height="19" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">budget
        cost</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="budgetcost" value="3kto15k" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="budgetcost" value="18kto45k" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="budgetcost" value="over50k" />
       </div></td>
     </tr>
     <tr>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">low</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">medium</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">high</div></td>
     </tr>
     <tr>
      <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">project
        deadline<br />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="projectdeadline" value="low" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="projectdeadline" value="medium" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="projectdeadline" value="high" />
       </div></td>
     </tr>
     <tr>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
        rent</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
        sell</div></td>
      <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
        keep</div></td>
     </tr>
     <tr>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2">why build</td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="whybuild" value="rent" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="whybuild" value="sell" />
       </div></td>
      <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
        <input type="radio" name="whybuild" value="keep" />
       </div></td>
     </tr>
    </table>
    <table width="100%" border="0" cellpadding="4" cellspacing="0" class="textstyle">
     <tr bgcolor="#F2FFF2">
      <td width="25%">any other notes</td>
      <td width="75%" bgcolor="#F2FFF2"><textarea name="otherpreferences" cols="40" class="textstyle" id="otherpreferences"></textarea></td>
     </tr>
    </table> <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
     <tr bgcolor="#F2FFF2">
      <td width="49%"><div align="right">
        <input type="submit" name="submit" value="submit" class="textstyle"/>
       </div></td>
      <td width="2%">&nbsp;</td>
      <td width="49%"><input name="reset" type="reset" id="reset" value="reset" class="textstyle" /></td>
     </tr>
    </table>
   </form></td>
 </tr>
</table>
</body>
</html>
  1. <head>
  2. <title>SIGN UP</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <SCRIPT LANGUAGE="JavaScript">
  5. <!--
  6. function redirect () { setTimeout("go_now()",4000); }
  7. function go_now ()  { window.location.href = "getstartedformtrial.php"; }
  8. //-->
  9. </SCRIPT>
  10. </head>
  11. <?php
  12. if ($_POST['submit'])
  13. {
  14. $user="";
  15. $host="localhost";
  16. $password="";
  17. $database="";
  18. $connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
  19. $db=mysql_select_db($database,$connection);
  20. $errCount   = 0;
  21. $fineCount  = 0;
  22. $errMessage  = "";
  23. $required_fields=array('name','email','contact_address','mobile','workhome_tel','contact_postcode','project_postcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  24. $field_errors=array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
  25. for($i=0;$i<count($required_fields);$i++) {
  26.   if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  27.     $err[$errCount]='You must provide a '.$_POST[$required_fields[$i]];
  28.     $errCount   = $errCount + 1;
  29.     $errMessage  = "$errMessage ".$_POST[$field_errors[$i]];
  30.   }else{
  31.     $field[$fineCount] = $_POST[$required_fields[$i]];
  32.     $fineCount  = $fineCount + 1;
  33.   }
  34. }
  35. if (count($err)>0) {
  36.   //output error code
  37.   $strOut = "Your submision generated the following errors:<br>";
  38.   $errors = preg_split('/ /', $errMessage, -1);
  39.   foreach($errors as $e) {
  40.     echo $field_errors[$e] . "<br>";
  41.   }
  42. }else{
  43. $sql = "insert into gstrialforma(name, email, contactaddress, mobile, workhometel, contactpostcode, projectpostcode, doyouneed, designstyle, project, uses, engineer, partywall, architect, projectmanager, design, lifestyle, structural, planning, buildingregs, otherhelp, wheelchair, partialeyesight, terraced, familychildern, semidetached, aged, allergy, detached, other, otherneeds, specifyneeds, programtimecompletion, budgetcost, projectdeadline, whybuild, otherpreferences) values ('{$_POST['name']}','{$_POST['email']}','{$_POST['contactaddress']}','{$_POST['mobile']}','{$_POST['workhometel']}','{$_POST['contactpostcode']}','{$_POST['projectpostcode']}','{$_POST['doyouneed']}','{$_POST['designstyle']}','{$_POST['project']}','{$_POST['uses']}','{$_POST['engineer']}','{$_POST['partywall']}','{$_POST['architect']}','{$_POST['projectmanager']}','{$_POST['design']}','{$_POST['lifestyle']}','{$_POST['structural']}','{$_POST['planning']}','{$_POST['buildingregs']}','{$_POST['otherhelp']}','{$_POST['wheelchair']}','{$_POST['partialeyesight']}','{$_POST['terraced']}','{$_POST['familychildern']}','{$_POST['semidetached']}','{$_POST['aged']}','{$_POST['allergy']}','{$_POST['detached']}','{$_POST['other']}','{$_POST['otherneeds']}','{$_POST['specifyneeds']}','{$_POST['programtimecompletion']}','{$_POST['budgetcost']}','{$_POST['projectdeadline']}','{$_POST['whybuild']}','{$_POST['otherpreferences']}')";
  44. $result = mysql_query($sql) or print(mysql_error());
  45. //mail($to, $subject, $msg, $additional_headers);
  46. mail($_POST['email'],'hello there','Hello '.$_POST['name'].', thank you for filling out the form ', "From: athompson@building-doctors.com");
  47. echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext><tr><td>";
  48. echo 'Hello '.$_POST['name'].', thank you for filling out the form ';
  49. echo "</tr></td></table>";
  50. echo "<body onLoad=redirect() text=#000000 link=#00FFFF vlink=#C0C0C0>";
  51. }
  52. else
  53. {
  54. ?>
  55. <body leftmargin="0" topmargin="0">
  56. <table width="400" height="246" border="0" cellpadding="0" cellspacing="0" class="biggertext">
  57.  <tr>
  58.   <td height="30" valign="top"><form method="POST" action="getstartedformtrial.php">
  59.     <table width="400" border="0" cellspacing="0" cellpadding="4">
  60.      <tr>
  61.       <td align="center"><img src="images/cr_header.gif" width="404" height="55" /></td>
  62.      </tr>
  63.     </table>
  64.     <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  65.      <tr bgcolor="#305A36">
  66.       <td height="24" colspan="2" class="boldtext"><div align="center" class="stylewht">personal
  67.         details </div></td>
  68.      </tr>
  69.      <tr bgcolor="#F4FFF4">
  70.       <td width="199">name:<br /> <input type="text" name="name" id="name" class="textstyle" /></td>
  71.       <td width="199">email: <br /> <input type="text" name="email" id="email" class="textstyle"/></td>
  72.      </tr>
  73.      <tr bgcolor="#F4FFF4">
  74.       <td rowspan="2">contact address:
  75.        <textarea name="contactaddress" cols="20" rows="2" id="contactaddress"></textarea></td>
  76.       <td>mobile:<br /> <input name="mobile" type="text" class="textstyle" id="mobile"/></td>
  77.      </tr>
  78.      <tr>
  79.       <td bgcolor="#F4FFF4">work/home tel:
  80.        <input name="workhometel" type="text" class="textstyle" id="workhometel"/></td>
  81.      </tr>
  82.      <tr bgcolor="#F4FFF4">
  83.       <td>contact postcode:<br /> <input name="contactpostcode" type="text" class="textstyle" id="contactpostcode" /></td>
  84.       <td bgcolor="#F4FFF4">project postcode: <br /> <input name="projectpostcode" type="text" class="textstyle" id="projectpostcode"/>
  85.       </td>
  86.      </tr>
  87.     </table>
  88.     <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  89.      <tr bgcolor="#F4FFF4">
  90.       <td width="20%">do you need</td>
  91.       <td width="26%"><div align="right">refurb
  92.         <input type="radio" name="doyouneed" value="refurb" />
  93.        </div></td>
  94.       <td width="30%"><div align="right">extra space
  95.         <input type="radio" name="doyouneed" value="extraspace" />
  96.        </div></td>
  97.       <td width="24%"><div align="right">extra light
  98.         <input type="radio" name="doyouneed" value="extralight" />
  99.        </div></td>
  100.      </tr>
  101.      <tr bgcolor="#F4FFF4">
  102.       <td>design style</td>
  103.       <td><div align="right">contemp'ry
  104.         <input type="radio" name="designstyle" value="contemporary" />
  105.        </div></td>
  106.       <td><div align="right">traditional
  107.         <input type="radio" name="designstyle" value="traditional" />
  108.        </div></td>
  109.       <td><div align="right">mixed
  110.         <input type="radio" name="designstyle" value="mixed" />
  111.        </div></td>
  112.      </tr>
  113.     </table>
  114.     <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  115.      <tr bgcolor="#F4FFF4">
  116.       <td colspan="5">&nbsp;</td>
  117.      </tr>
  118.      <tr bgcolor="#F4FFF4">
  119.       <td width="20%">project</td>
  120.       <td width="19%"><div align="right">garden
  121.         <input type="radio" name="project" value="garden" />
  122.        </div></td>
  123.       <td width="18%"><div align="right">loft
  124.         <input type="radio" name="project" value="loft" />
  125.        </div></td>
  126.       <td width="17%"><div align="right">refit
  127.         <input type="radio" name="project" value="refit" />
  128.        </div></td>
  129.       <td width="26%"><div align="right">extension
  130.         <input type="radio" name="project" value="extension" />
  131.        </div></td>
  132.      </tr>
  133.      <tr bgcolor="#F4FFF4">
  134.       <td>use</td>
  135.       <td><div align="right">shop
  136.         <input type="radio" name="uses" value="shop" />
  137.        </div></td>
  138.       <td><div align="right">office
  139.         <input type="radio" name="uses" value="office" />
  140.        </div></td>
  141.       <td><div align="right">home
  142.         <input type="radio" name="uses" value="home" />
  143.        </div></td>
  144.       <td><div align="right">other
  145.         <input type="radio" name="uses" value="other" />
  146.        </div></td>
  147.      </tr>
  148.     </table>
  149.     <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
  150.      <tr>
  151.       <td height="24" colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">type
  152.         of help required</div></td>
  153.       <td colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">special
  154.         needs</div></td>
  155.      </tr>
  156.      <tr bgcolor="#F4FFF4">
  157.       <td width="22%" bordercolor="#FFFFFF"><div align="left">engineer</div></td>
  158.       <td width="24%" bordercolor="#FFFFFF" bgcolor="#F4FFF4"> <div align="left">
  159.         <input name="engineer" type="checkbox" class="textstyle" id="engineer" value="yes"/>
  160.        </div></td>
  161.       <td width="30%" bordercolor="#FFFFFF"><div align="left">Wheelchair
  162.         ecology</div></td>
  163.       <td width="24%" bordercolor="#FFFFFF"><div align="right">
  164.         <input name="wheelchair" type="checkbox" class="textstyle" id="wheelchair" value="yes"/>
  165.        </div></td>
  166.      </tr>
  167.      <tr bgcolor="#F4FFF4">
  168.       <td bordercolor="#FFFFFF"><div align="left">party wall</div></td>
  169.       <td bordercolor="#FFFFFF"> <div align="left">
  170.         <input name="partywall" type="checkbox" class="textstyle" id="partywall2" value="yes"/>
  171.        </div></td>
  172.       <td bordercolor="#FFFFFF"><div align="left">Partial eyesight</div></td>
  173.       <td bordercolor="#FFFFFF"><div align="right">
  174.         <input name="partialeyesight" type="checkbox" class="textstyle" id="partialeyesight" value="yes"/>
  175.        </div></td>
  176.      </tr>
  177.      <tr bgcolor="#F4FFF4">
  178.       <td bordercolor="#FFFFFF"><div align="left">architect</div></td>
  179.       <td bordercolor="#FFFFFF"> <div align="left">
  180.         <input name="architect" type="checkbox" class="textstyle" id="architect" value="yes"/>
  181.        </div></td>
  182.       <td bordercolor="#FFFFFF"><div align="left">terraced</div></td>
  183.       <td bordercolor="#FFFFFF"><div align="right">
  184.         <input name="terraced" type="checkbox" class="textstyle" id="terraced" value="yes"/>
  185.        </div></td>
  186.      </tr>
  187.      <tr bgcolor="#F4FFF4">
  188.       <td height="33" bordercolor="#FFFFFF"><div align="left">project manager</div></td>
  189.       <td bordercolor="#FFFFFF"> <div align="left">
  190.         <input name="projectmanager" type="checkbox" class="textstyle" id="projectmanager" value="yes"/>
  191.        </div></td>
  192.       <td bordercolor="#FFFFFF"><div align="left">family &amp; <br />
  193.         children</div></td>
  194.       <td bordercolor="#FFFFFF"><div align="right">
  195.         <input name="familychildern" type="checkbox" class="textstyle" id="familychildern" value="yes"/>
  196.        </div></td>
  197.      </tr>
  198.      <tr bgcolor="#F4FFF4">
  199.       <td bordercolor="#FFFFFF"><div align="left">design</div></td>
  200.       <td bordercolor="#FFFFFF"> <div align="left">
  201.         <input name="design" type="checkbox" class="textstyle" id="design" value="yes"/>
  202.        </div></td>
  203.       <td bordercolor="#FFFFFF"><div align="left">semi-detached</div></td>
  204.       <td bordercolor="#FFFFFF"><div align="right">
  205.         <input name="semidetached" type="checkbox" class="textstyle" id="semidetached" value="yes"/>
  206.        </div></td>
  207.      </tr>
  208.      <tr bgcolor="#F4FFF4">
  209.       <td bordercolor="#FFFFFF"><div align="left">lifestyle</div></td>
  210.       <td bordercolor="#FFFFFF"> <div align="left">
  211.         <input name="lifestyle" type="checkbox" class="textstyle" id="lifestyle" value="yes"/>
  212.        </div></td>
  213.       <td bordercolor="#FFFFFF"><div align="left">aged</div></td>
  214.       <td bordercolor="#FFFFFF"><div align="right">
  215.         <input name="aged" type="checkbox" class="textstyle" id="aged" value="yes"/>
  216.        </div></td>
  217.      </tr>
  218.      <tr bgcolor="#F4FFF4">
  219.       <td bordercolor="#FFFFFF"><div align="left">structural</div></td>
  220.       <td bordercolor="#FFFFFF"> <div align="left">
  221.         <input name="structural" type="checkbox" class="textstyle" id="structural" value="yes"/>
  222.        </div></td>
  223.       <td bordercolor="#FFFFFF"><div align="left">allergy</div></td>
  224.       <td bordercolor="#FFFFFF"><div align="right">
  225.         <input name="allergy" type="checkbox" class="textstyle" id="allergy" value="yes"/>
  226.        </div></td>
  227.      </tr>
  228.      <tr bgcolor="#F4FFF4">
  229.       <td bordercolor="#FFFFFF"><div align="left">planning</div></td>
  230.       <td bordercolor="#FFFFFF"> <div align="left">
  231.         <input name="planning" type="checkbox" class="textstyle" id="planning" value="yes"/>
  232.        </div></td>
  233.       <td bordercolor="#FFFFFF"><div align="left">detached</div></td>
  234.       <td bordercolor="#FFFFFF"><div align="right">
  235.         <input name="detached" type="checkbox" class="textstyle" id="detached" value="yes"/>
  236.        </div></td>
  237.      </tr>
  238.      <tr bgcolor="#F4FFF4">
  239.       <td bordercolor="#FFFFFF"><div align="left">building regs</div></td>
  240.       <td bordercolor="#FFFFFF"> <div align="left">
  241.         <input name="buildingregs" type="checkbox" class="textstyle" id="buildingregs" value="yes"/>
  242.        </div></td>
  243.       <td bordercolor="#FFFFFF"><div align="left">other</div></td>
  244.       <td bordercolor="#FFFFFF"><div align="right">
  245.         <input name="otherneeds" type="checkbox" class="textstyle" id="otherneeds" value="yes"/>
  246.        </div></td>
  247.      </tr>
  248.      <tr bgcolor="#F4FFF4">
  249.       <td bordercolor="#FFFFFF"><div align="left">other </div></td>
  250.       <td bordercolor="#FFFFFF"> <div align="left">
  251.         <input name="otherhelp" type="text" class="textstyle" id="otherhelp" size="15"/>
  252.        </div></td>
  253.       <td bordercolor="#FFFFFF"><div align="left">please specify </div></td>
  254.       <td bordercolor="#FFFFFF"><div align="right">
  255.         <input name="specifyneeds" type="text" class="textstyle" id="specifyneeds" size="15"/>
  256.        </div></td>
  257.      </tr>
  258.     </table>
  259.     <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
  260.      <tr bgcolor="#305A36">
  261.       <td height="24" colspan="4" class="boldtext"><div align="center" class="stylewht">Customer
  262.         Preferences</div></td>
  263.      </tr>
  264.      <tr>
  265.       <td width="23%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>months</strong></div></td>
  266.       <td width="24%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">1</div></td>
  267.       <td width="30%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">6</div></td>
  268.       <td width="22%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">9</div></td>
  269.      </tr>
  270.      <tr>
  271.       <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">program
  272.         time completion</div></td>
  273.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  274.         <input type="radio" name="programtimecompletion" value="1month" />
  275.        </div></td>
  276.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  277.         <input type="radio" name="programtimecompletion" value="6months" />
  278.        </div></td>
  279.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  280.         <input type="radio" name="programtimecompletion" value="9months" />
  281.        </div></td>
  282.      </tr>
  283.      <tr>
  284.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>k=1000</strong></div></td>
  285.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">3k
  286.         - 15k</div></td>
  287.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">18k
  288.         - 45k</div></td>
  289.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">&nbsp;
  290.         &gt; 50k</div></td>
  291.      </tr>
  292.      <tr>
  293.       <td height="19" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">budget
  294.         cost</div></td>
  295.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  296.         <input type="radio" name="budgetcost" value="3kto15k" />
  297.        </div></td>
  298.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  299.         <input type="radio" name="budgetcost" value="18kto45k" />
  300.        </div></td>
  301.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  302.         <input type="radio" name="budgetcost" value="over50k" />
  303.        </div></td>
  304.      </tr>
  305.      <tr>
  306.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
  307.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">low</div></td>
  308.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">medium</div></td>
  309.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">high</div></td>
  310.      </tr>
  311.      <tr>
  312.       <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">project
  313.         deadline<br />
  314.        </div></td>
  315.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  316.         <input type="radio" name="projectdeadline" value="low" />
  317.        </div></td>
  318.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  319.         <input type="radio" name="projectdeadline" value="medium" />
  320.        </div></td>
  321.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  322.         <input type="radio" name="projectdeadline" value="high" />
  323.        </div></td>
  324.      </tr>
  325.      <tr>
  326.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
  327.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  328.         rent</div></td>
  329.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  330.         sell</div></td>
  331.       <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  332.         keep</div></td>
  333.      </tr>
  334.      <tr>
  335.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2">why build</td>
  336.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  337.         <input type="radio" name="whybuild" value="rent" />
  338.        </div></td>
  339.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  340.         <input type="radio" name="whybuild" value="sell" />
  341.        </div></td>
  342.       <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  343.         <input type="radio" name="whybuild" value="keep" />
  344.        </div></td>
  345.      </tr>
  346.     </table>
  347.     <table width="100%" border="0" cellpadding="4" cellspacing="0" class="textstyle">
  348.      <tr bgcolor="#F2FFF2">
  349.       <td width="25%">any other notes</td>
  350.       <td width="75%" bgcolor="#F2FFF2"><textarea name="otherpreferences" cols="40" class="textstyle" id="otherpreferences"></textarea></td>
  351.      </tr>
  352.     </table> <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
  353.      <tr bgcolor="#F2FFF2">
  354.       <td width="49%"><div align="right">
  355.         <input type="submit" name="submit" value="submit" class="textstyle"/>
  356.        </div></td>
  357.       <td width="2%">&nbsp;</td>
  358.       <td width="49%"><input name="reset" type="reset" id="reset" value="reset" class="textstyle" /></td>
  359.      </tr>
  360.     </table>
  361.    </form></td>
  362.  </tr>
  363. </table>
  364. </body>
  365. </html>


this is the whole php/html form with php validation and confirmation plus an autoresponder.

scorpius, if you want to look at this then feel free to.

before the validation was added, the form worked. now that validation has been added i am getting alot of error statements. once the page just hung and didnt work at all until i re entered the address. would love for someone to have a go at this and post up the result
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

You are missing a '}' at the begining of your last else statement.

I am looking at the code now but it is a heck of a mess, will try clean it up and find a solution for you.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Okay this was just getting way to mess, so what I have done is divided the situation into two pages, one containing a function that creates a string containing the form and the other that deals with validation and displaying the info.

Right your first page will look like this (getstartedformtrial.php)
Code: [ Select ]
<head>
<title>SIGN UP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<SCRIPT LANGUAGE="JavaScript">
<!--
function redirect () { setTimeout("go_now()",4000); }
function go_now ()  { window.location.href = "getstartedformtrial.php"; }
//-->
</SCRIPT>
</head>
  1. <head>
  2. <title>SIGN UP</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <SCRIPT LANGUAGE="JavaScript">
  5. <!--
  6. function redirect () { setTimeout("go_now()",4000); }
  7. function go_now ()  { window.location.href = "getstartedformtrial.php"; }
  8. //-->
  9. </SCRIPT>
  10. </head>

then add this to the same page:
PHP Code: [ Select ]
<?php
include_once("printForm.php");
$action = (empty($_GET['a'])) ? "" : $_GET['a'];
$form = printForm();
if ($action == 1) {
   $user          = "";
   $host          = "localhost";
   $password         = "";
   $database         = "";
   $connection       = mysql_connect($host,$user,$password) or die ("could not connect to server");
   $db               = mysql_select_db($database,$connection);
   $errCount         = 0;
   $fineCount        = 0;
   $errMessage       = "";
   $required_fields  = array('name','email','contactaddress','mobile','workhometel','contactpostcode','projectpostcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
   $field_errors     = array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
   for($i=0;$i<count($required_fields);$i++) {
       if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
           $err[$errCount] ='You must provide '.$field_errors[$i];
           $errCount       = $errCount + 1;
       }else{
           $field[$fineCount]    = $_POST[$required_fields[$i]];
           $fineCount         = $fineCount + 1;
       }
   }
   if (count($err)>0) {
       //output error code
      $error   = "";
       $error = "Your submision generated the following errors:<ul>";
       for ($i=0;$i<count($err);$i++){
         $error .= "<li>" . $err[$i] . "</li>";
      }
      $error   .= "</ul>";
      $form = printForm($error);
      echo $form;
   }else{
      $sql = "insert into gstrialforma(name, email, contactaddress, mobile, workhometel, contactpostcode, projectpostcode, doyouneed, designstyle, project, uses, engineer, partywall, architect, projectmanager, design, lifestyle, structural, planning, buildingregs, otherhelp, wheelchair, partialeyesight, terraced, familychildern, semidetached, aged, allergy, detached, other, otherneeds, specifyneeds, programtimecompletion, budgetcost, projectdeadline, whybuild, otherpreferences) values ('{$_POST['name']}','{$_POST['email']}','{$_POST['contactaddress']}','{$_POST['mobile']}','{$_POST['workhometel']}','{$_POST['contactpostcode']}','{$_POST['projectpostcode']}','{$_POST['doyouneed']}','{$_POST['designstyle']}','{$_POST['project']}','{$_POST['uses']}','{$_POST['engineer']}','{$_POST['partywall']}','{$_POST['architect']}','{$_POST['projectmanager']}','{$_POST['design']}','{$_POST['lifestyle']}','{$_POST['structural']}','{$_POST['planning']}','{$_POST['buildingregs']}','{$_POST['otherhelp']}','{$_POST['wheelchair']}','{$_POST['partialeyesight']}','{$_POST['terraced']}','{$_POST['familychildern']}','{$_POST['semidetached']}','{$_POST['aged']}','{$_POST['allergy']}','{$_POST['detached']}','{$_POST['other']}','{$_POST['otherneeds']}','{$_POST['specifyneeds']}','{$_POST['programtimecompletion']}','{$_POST['budgetcost']}','{$_POST['projectdeadline']}','{$_POST['whybuild']}','{$_POST['otherpreferences']}')";
      $result = mysql_query($sql) or print(mysql_error());
      //mail($to, $subject, $msg, $additional_headers);
      mail($_POST['email'],'hello there','Hello '.$_POST['name'].', thank you for filling out the form ', "From: athompson@building-doctors.com");
      echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext><tr><td>";
      echo 'Hello '.$_POST['name'].', thank you for filling out the form ';
      echo "</tr></td></table>";
      echo "<body onLoad=redirect() text=#000000 link=#00FFFF vlink=#C0C0C0>";
   }
}else{
   print $form; //THIS IS THE WAY IT SHOULD HAVE BEEN
}
?>
 
  1. <?php
  2. include_once("printForm.php");
  3. $action = (empty($_GET['a'])) ? "" : $_GET['a'];
  4. $form = printForm();
  5. if ($action == 1) {
  6.    $user          = "";
  7.    $host          = "localhost";
  8.    $password         = "";
  9.    $database         = "";
  10.    $connection       = mysql_connect($host,$user,$password) or die ("could not connect to server");
  11.    $db               = mysql_select_db($database,$connection);
  12.    $errCount         = 0;
  13.    $fineCount        = 0;
  14.    $errMessage       = "";
  15.    $required_fields  = array('name','email','contactaddress','mobile','workhometel','contactpostcode','projectpostcode','designstyle','programtimecompletion','budgetcost','feeconstraint','projectdeadline','reason2build');
  16.    $field_errors     = array('your name please','your email address','your contact address','your mobile phone number','your work or home tel. number','what is your contact postcode','what is the project postcode','your style of design','time estimated to complete program','your budget for project','your fee constraint','importance of project deadline','your reason to build');
  17.    for($i=0;$i<count($required_fields);$i++) {
  18.        if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  19.            $err[$errCount] ='You must provide '.$field_errors[$i];
  20.            $errCount       = $errCount + 1;
  21.        }else{
  22.            $field[$fineCount]    = $_POST[$required_fields[$i]];
  23.            $fineCount         = $fineCount + 1;
  24.        }
  25.    }
  26.    if (count($err)>0) {
  27.        //output error code
  28.       $error   = "";
  29.        $error = "Your submision generated the following errors:<ul>";
  30.        for ($i=0;$i<count($err);$i++){
  31.          $error .= "<li>" . $err[$i] . "</li>";
  32.       }
  33.       $error   .= "</ul>";
  34.       $form = printForm($error);
  35.       echo $form;
  36.    }else{
  37.       $sql = "insert into gstrialforma(name, email, contactaddress, mobile, workhometel, contactpostcode, projectpostcode, doyouneed, designstyle, project, uses, engineer, partywall, architect, projectmanager, design, lifestyle, structural, planning, buildingregs, otherhelp, wheelchair, partialeyesight, terraced, familychildern, semidetached, aged, allergy, detached, other, otherneeds, specifyneeds, programtimecompletion, budgetcost, projectdeadline, whybuild, otherpreferences) values ('{$_POST['name']}','{$_POST['email']}','{$_POST['contactaddress']}','{$_POST['mobile']}','{$_POST['workhometel']}','{$_POST['contactpostcode']}','{$_POST['projectpostcode']}','{$_POST['doyouneed']}','{$_POST['designstyle']}','{$_POST['project']}','{$_POST['uses']}','{$_POST['engineer']}','{$_POST['partywall']}','{$_POST['architect']}','{$_POST['projectmanager']}','{$_POST['design']}','{$_POST['lifestyle']}','{$_POST['structural']}','{$_POST['planning']}','{$_POST['buildingregs']}','{$_POST['otherhelp']}','{$_POST['wheelchair']}','{$_POST['partialeyesight']}','{$_POST['terraced']}','{$_POST['familychildern']}','{$_POST['semidetached']}','{$_POST['aged']}','{$_POST['allergy']}','{$_POST['detached']}','{$_POST['other']}','{$_POST['otherneeds']}','{$_POST['specifyneeds']}','{$_POST['programtimecompletion']}','{$_POST['budgetcost']}','{$_POST['projectdeadline']}','{$_POST['whybuild']}','{$_POST['otherpreferences']}')";
  38.       $result = mysql_query($sql) or print(mysql_error());
  39.       //mail($to, $subject, $msg, $additional_headers);
  40.       mail($_POST['email'],'hello there','Hello '.$_POST['name'].', thank you for filling out the form ', "From: athompson@building-doctors.com");
  41.       echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext><tr><td>";
  42.       echo 'Hello '.$_POST['name'].', thank you for filling out the form ';
  43.       echo "</tr></td></table>";
  44.       echo "<body onLoad=redirect() text=#000000 link=#00FFFF vlink=#C0C0C0>";
  45.    }
  46. }else{
  47.    print $form; //THIS IS THE WAY IT SHOULD HAVE BEEN
  48. }
  49. ?>
  50.  

and to close it off add a little:
Code: [ Select ]
</body>
</html>
  1. </body>
  2. </html>


okay then we make another file called printForm.php (make sure it is saved in the same directory as the above file
PHP Code: [ Select ]
 
<?php
 
function printForm($err = ""){
 
$strOut = '<body leftmargin="0" topmargin="0">
 
<table width="400"  height="246" border="0" cellpadding="0" cellspacing="0" class="biggertext">
 
 <tr>
 
   <td height="30" valign="top"><form method="POST" action="getstartedformtrial.php?a=1">
 
      <table width="400" border="0" cellspacing="0" cellpadding="4">
 
         <tr>
 
           <td align="center"><img src="images/cr_header.gif" width="404" height="55" /></td>
 
         </tr>
 
       </table>
 
      <table width="400" border="0" cellspacing="0" cellpadding="4">
 
         <tr>
 
           <td align="left">'.$err.'</td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
 
         <tr bgcolor="#305A36">
 
           <td height="24" colspan="2" class="boldtext"><div align="center" class="stylewht">personal
 
               details </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td width="199">name:<br /> <input type="text" name="name"  id="name" class="textstyle" /></td>
 
           <td width="199">email: <br /> <input type="text" name="email" id="email" class="textstyle"/></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td rowspan="2">contact address:
 
             <textarea name="contactaddress" cols="20" rows="2" id="contactaddress"></textarea></td>
 
           <td>mobile:<br /> <input name="mobile" type="text" class="textstyle" id="mobile"/></td>
 
         </tr>
 
         <tr>
 
           <td bgcolor="#F4FFF4">work/home tel:
 
             <input name="workhometel" type="text" class="textstyle" id="workhometel"/></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td>contact postcode:<br /> <input name="contactpostcode" type="text" class="textstyle" id="contactpostcode" /></td>
 
           <td bgcolor="#F4FFF4">project postcode: <br /> <input name="projectpostcode" type="text" class="textstyle" id="projectpostcode"/>
 
           </td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
 
         <tr bgcolor="#F4FFF4">
 
           <td width="20%">do you need</td>
 
           <td width="26%"><div align="right">refurb
 
               <input type="radio" name="doyouneed" value="refurb" />
 
             </div></td>
 
           <td width="30%"><div align="right">extra space
 
               <input type="radio" name="doyouneed" value="extraspace" />
 
             </div></td>
 
           <td width="24%"><div align="right">extra light
 
               <input type="radio" name="doyouneed" value="extralight" />
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td>design style</td>
 
           <td><div align="right">contemp\'ry
 
               <input type="radio" name="designstyle" value="contemporary" />
 
             </div></td>
 
           <td><div align="right">traditional
 
               <input type="radio" name="designstyle" value="traditional" />
 
             </div></td>
 
           <td><div align="right">mixed
 
               <input type="radio" name="designstyle" value="mixed" />
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
 
         <tr bgcolor="#F4FFF4">
 
           <td colspan="5">&nbsp;</td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td width="20%">project</td>
 
           <td width="19%"><div align="right">garden
 
               <input type="radio" name="project" value="garden" />
 
             </div></td>
 
           <td width="18%"><div align="right">loft
 
               <input type="radio" name="project" value="loft" />
 
             </div></td>
 
           <td width="17%"><div align="right">refit
 
               <input type="radio" name="project" value="refit" />
 
             </div></td>
 
           <td width="26%"><div align="right">extension
 
               <input type="radio" name="project" value="extension" />
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td>use</td>
 
           <td><div align="right">shop
 
               <input type="radio" name="uses" value="shop" />
 
             </div></td>
 
           <td><div align="right">office
 
               <input type="radio" name="uses" value="office" />
 
             </div></td>
 
           <td><div align="right">home
 
               <input type="radio" name="uses" value="home" />
 
             </div></td>
 
           <td><div align="right">other
 
               <input type="radio" name="uses" value="other" />
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
 
         <tr>
 
           <td height="24" colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">type
 
               of help required</div></td>
 
           <td colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">special
 
               needs</div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td width="22%" bordercolor="#FFFFFF"><div align="left">engineer</div></td>
 
           <td width="24%" bordercolor="#FFFFFF" bgcolor="#F4FFF4"> <div align="left">
 
               <input name="engineer" type="checkbox"  class="textstyle" id="engineer" value="yes"/>
 
             </div></td>
 
           <td width="30%" bordercolor="#FFFFFF"><div align="left">Wheelchair
 
               ecology</div></td>
 
           <td width="24%" bordercolor="#FFFFFF"><div align="right">
 
               <input name="wheelchair" type="checkbox"  class="textstyle" id="wheelchair" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">party wall</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="partywall" type="checkbox"  class="textstyle" id="partywall2" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">Partial eyesight</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="partialeyesight" type="checkbox"  class="textstyle" id="partialeyesight" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">architect</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="architect" type="checkbox"  class="textstyle" id="architect" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">terraced</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="terraced" type="checkbox"  class="textstyle" id="terraced" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td height="33" bordercolor="#FFFFFF"><div align="left">project manager</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="projectmanager" type="checkbox"  class="textstyle" id="projectmanager" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">family &amp; <br />
 
               children</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="familychildern" type="checkbox"  class="textstyle" id="familychildern" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">design</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="design" type="checkbox"  class="textstyle" id="design" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">semi-detached</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="semidetached" type="checkbox"  class="textstyle" id="semidetached" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">lifestyle</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="lifestyle" type="checkbox"  class="textstyle" id="lifestyle" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">aged</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="aged" type="checkbox"  class="textstyle" id="aged" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">structural</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="structural" type="checkbox"  class="textstyle" id="structural" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">allergy</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="allergy" type="checkbox"  class="textstyle" id="allergy" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">planning</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="planning" type="checkbox"  class="textstyle" id="planning" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">detached</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="detached" type="checkbox"  class="textstyle" id="detached" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">building regs</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="buildingregs" type="checkbox"  class="textstyle" id="buildingregs" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">other</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="otherneeds" type="checkbox"  class="textstyle" id="otherneeds" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">other </div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="otherhelp" type="text"  class="textstyle" id="otherhelp" size="15"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">please specify </div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="specifyneeds" type="text"  class="textstyle" id="specifyneeds" size="15"/>
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
 
         <tr bgcolor="#305A36">
 
           <td height="24" colspan="4" class="boldtext"><div align="center" class="stylewht">Customer
 
               Preferences</div></td>
 
         </tr>
 
         <tr>
 
           <td width="23%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>months</strong></div></td>
 
           <td width="24%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">1</div></td>
 
           <td width="30%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">6</div></td>
 
           <td width="22%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">9</div></td>
 
         </tr>
 
         <tr>
 
           <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">program
 
               time completion</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="programtimecompletion" value="1month" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="programtimecompletion" value="6months" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="programtimecompletion" value="9months" />
 
             </div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>k=1000</strong></div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">3k
 
               - 15k</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">18k
 
               - 45k</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">&nbsp;
 
               &gt; 50k</div></td>
 
         </tr>
 
         <tr>
 
           <td height="19" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">budget
 
               cost</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="budgetcost" value="3kto15k" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="budgetcost" value="18kto45k" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="budgetcost" value="over50k" />
 
             </div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">low</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">medium</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">high</div></td>
 
         </tr>
 
         <tr>
 
           <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">project
 
               deadline<br />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="projectdeadline" value="low" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="projectdeadline" value="medium" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="projectdeadline" value="high" />
 
             </div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
 
               rent</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
 
               sell</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
 
               keep</div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2">why build</td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="whybuild" value="rent" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="whybuild" value="sell" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="whybuild" value="keep" />
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="0" cellpadding="4" cellspacing="0" class="textstyle">
 
         <tr bgcolor="#F2FFF2">
 
           <td width="25%">any other notes</td>
 
           <td width="75%" bgcolor="#F2FFF2"><textarea name="otherpreferences" cols="40" class="textstyle" id="otherpreferences"></textarea></td>
 
         </tr>
 
       </table>  <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
 
         <tr bgcolor="#F2FFF2">
 
           <td width="49%"><div align="right">
 
               <input type="submit" name="submit" value="submit" class="textstyle"/>
 
             </div></td>
 
           <td width="2%">&nbsp;</td>
 
           <td width="49%"><input name="reset" type="reset" id="reset" value="reset" class="textstyle" /></td>
 
         </tr>
 
       </table>
 
     </form></td>
 
 </tr>
 
</table>';
 
return $strOut;
 
}
 
 
 
?>
 
 
  1.  
  2. <?php
  3.  
  4. function printForm($err = ""){
  5.  
  6. $strOut = '<body leftmargin="0" topmargin="0">
  7.  
  8. <table width="400"  height="246" border="0" cellpadding="0" cellspacing="0" class="biggertext">
  9.  
  10.  <tr>
  11.  
  12.    <td height="30" valign="top"><form method="POST" action="getstartedformtrial.php?a=1">
  13.  
  14.       <table width="400" border="0" cellspacing="0" cellpadding="4">
  15.  
  16.          <tr>
  17.  
  18.            <td align="center"><img src="images/cr_header.gif" width="404" height="55" /></td>
  19.  
  20.          </tr>
  21.  
  22.        </table>
  23.  
  24.       <table width="400" border="0" cellspacing="0" cellpadding="4">
  25.  
  26.          <tr>
  27.  
  28.            <td align="left">'.$err.'</td>
  29.  
  30.          </tr>
  31.  
  32.        </table>
  33.  
  34.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  35.  
  36.          <tr bgcolor="#305A36">
  37.  
  38.            <td height="24" colspan="2" class="boldtext"><div align="center" class="stylewht">personal
  39.  
  40.                details </div></td>
  41.  
  42.          </tr>
  43.  
  44.          <tr bgcolor="#F4FFF4">
  45.  
  46.            <td width="199">name:<br /> <input type="text" name="name"  id="name" class="textstyle" /></td>
  47.  
  48.            <td width="199">email: <br /> <input type="text" name="email" id="email" class="textstyle"/></td>
  49.  
  50.          </tr>
  51.  
  52.          <tr bgcolor="#F4FFF4">
  53.  
  54.            <td rowspan="2">contact address:
  55.  
  56.              <textarea name="contactaddress" cols="20" rows="2" id="contactaddress"></textarea></td>
  57.  
  58.            <td>mobile:<br /> <input name="mobile" type="text" class="textstyle" id="mobile"/></td>
  59.  
  60.          </tr>
  61.  
  62.          <tr>
  63.  
  64.            <td bgcolor="#F4FFF4">work/home tel:
  65.  
  66.              <input name="workhometel" type="text" class="textstyle" id="workhometel"/></td>
  67.  
  68.          </tr>
  69.  
  70.          <tr bgcolor="#F4FFF4">
  71.  
  72.            <td>contact postcode:<br /> <input name="contactpostcode" type="text" class="textstyle" id="contactpostcode" /></td>
  73.  
  74.            <td bgcolor="#F4FFF4">project postcode: <br /> <input name="projectpostcode" type="text" class="textstyle" id="projectpostcode"/>
  75.  
  76.            </td>
  77.  
  78.          </tr>
  79.  
  80.        </table>
  81.  
  82.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  83.  
  84.          <tr bgcolor="#F4FFF4">
  85.  
  86.            <td width="20%">do you need</td>
  87.  
  88.            <td width="26%"><div align="right">refurb
  89.  
  90.                <input type="radio" name="doyouneed" value="refurb" />
  91.  
  92.              </div></td>
  93.  
  94.            <td width="30%"><div align="right">extra space
  95.  
  96.                <input type="radio" name="doyouneed" value="extraspace" />
  97.  
  98.              </div></td>
  99.  
  100.            <td width="24%"><div align="right">extra light
  101.  
  102.                <input type="radio" name="doyouneed" value="extralight" />
  103.  
  104.              </div></td>
  105.  
  106.          </tr>
  107.  
  108.          <tr bgcolor="#F4FFF4">
  109.  
  110.            <td>design style</td>
  111.  
  112.            <td><div align="right">contemp\'ry
  113.  
  114.                <input type="radio" name="designstyle" value="contemporary" />
  115.  
  116.              </div></td>
  117.  
  118.            <td><div align="right">traditional
  119.  
  120.                <input type="radio" name="designstyle" value="traditional" />
  121.  
  122.              </div></td>
  123.  
  124.            <td><div align="right">mixed
  125.  
  126.                <input type="radio" name="designstyle" value="mixed" />
  127.  
  128.              </div></td>
  129.  
  130.          </tr>
  131.  
  132.        </table>
  133.  
  134.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  135.  
  136.          <tr bgcolor="#F4FFF4">
  137.  
  138.            <td colspan="5">&nbsp;</td>
  139.  
  140.          </tr>
  141.  
  142.          <tr bgcolor="#F4FFF4">
  143.  
  144.            <td width="20%">project</td>
  145.  
  146.            <td width="19%"><div align="right">garden
  147.  
  148.                <input type="radio" name="project" value="garden" />
  149.  
  150.              </div></td>
  151.  
  152.            <td width="18%"><div align="right">loft
  153.  
  154.                <input type="radio" name="project" value="loft" />
  155.  
  156.              </div></td>
  157.  
  158.            <td width="17%"><div align="right">refit
  159.  
  160.                <input type="radio" name="project" value="refit" />
  161.  
  162.              </div></td>
  163.  
  164.            <td width="26%"><div align="right">extension
  165.  
  166.                <input type="radio" name="project" value="extension" />
  167.  
  168.              </div></td>
  169.  
  170.          </tr>
  171.  
  172.          <tr bgcolor="#F4FFF4">
  173.  
  174.            <td>use</td>
  175.  
  176.            <td><div align="right">shop
  177.  
  178.                <input type="radio" name="uses" value="shop" />
  179.  
  180.              </div></td>
  181.  
  182.            <td><div align="right">office
  183.  
  184.                <input type="radio" name="uses" value="office" />
  185.  
  186.              </div></td>
  187.  
  188.            <td><div align="right">home
  189.  
  190.                <input type="radio" name="uses" value="home" />
  191.  
  192.              </div></td>
  193.  
  194.            <td><div align="right">other
  195.  
  196.                <input type="radio" name="uses" value="other" />
  197.  
  198.              </div></td>
  199.  
  200.          </tr>
  201.  
  202.        </table>
  203.  
  204.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
  205.  
  206.          <tr>
  207.  
  208.            <td height="24" colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">type
  209.  
  210.                of help required</div></td>
  211.  
  212.            <td colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">special
  213.  
  214.                needs</div></td>
  215.  
  216.          </tr>
  217.  
  218.          <tr bgcolor="#F4FFF4">
  219.  
  220.            <td width="22%" bordercolor="#FFFFFF"><div align="left">engineer</div></td>
  221.  
  222.            <td width="24%" bordercolor="#FFFFFF" bgcolor="#F4FFF4"> <div align="left">
  223.  
  224.                <input name="engineer" type="checkbox"  class="textstyle" id="engineer" value="yes"/>
  225.  
  226.              </div></td>
  227.  
  228.            <td width="30%" bordercolor="#FFFFFF"><div align="left">Wheelchair
  229.  
  230.                ecology</div></td>
  231.  
  232.            <td width="24%" bordercolor="#FFFFFF"><div align="right">
  233.  
  234.                <input name="wheelchair" type="checkbox"  class="textstyle" id="wheelchair" value="yes"/>
  235.  
  236.              </div></td>
  237.  
  238.          </tr>
  239.  
  240.          <tr bgcolor="#F4FFF4">
  241.  
  242.            <td bordercolor="#FFFFFF"><div align="left">party wall</div></td>
  243.  
  244.            <td bordercolor="#FFFFFF"> <div align="left">
  245.  
  246.                <input name="partywall" type="checkbox"  class="textstyle" id="partywall2" value="yes"/>
  247.  
  248.              </div></td>
  249.  
  250.            <td bordercolor="#FFFFFF"><div align="left">Partial eyesight</div></td>
  251.  
  252.            <td bordercolor="#FFFFFF"><div align="right">
  253.  
  254.                <input name="partialeyesight" type="checkbox"  class="textstyle" id="partialeyesight" value="yes"/>
  255.  
  256.              </div></td>
  257.  
  258.          </tr>
  259.  
  260.          <tr bgcolor="#F4FFF4">
  261.  
  262.            <td bordercolor="#FFFFFF"><div align="left">architect</div></td>
  263.  
  264.            <td bordercolor="#FFFFFF"> <div align="left">
  265.  
  266.                <input name="architect" type="checkbox"  class="textstyle" id="architect" value="yes"/>
  267.  
  268.              </div></td>
  269.  
  270.            <td bordercolor="#FFFFFF"><div align="left">terraced</div></td>
  271.  
  272.            <td bordercolor="#FFFFFF"><div align="right">
  273.  
  274.                <input name="terraced" type="checkbox"  class="textstyle" id="terraced" value="yes"/>
  275.  
  276.              </div></td>
  277.  
  278.          </tr>
  279.  
  280.          <tr bgcolor="#F4FFF4">
  281.  
  282.            <td height="33" bordercolor="#FFFFFF"><div align="left">project manager</div></td>
  283.  
  284.            <td bordercolor="#FFFFFF"> <div align="left">
  285.  
  286.                <input name="projectmanager" type="checkbox"  class="textstyle" id="projectmanager" value="yes"/>
  287.  
  288.              </div></td>
  289.  
  290.            <td bordercolor="#FFFFFF"><div align="left">family &amp; <br />
  291.  
  292.                children</div></td>
  293.  
  294.            <td bordercolor="#FFFFFF"><div align="right">
  295.  
  296.                <input name="familychildern" type="checkbox"  class="textstyle" id="familychildern" value="yes"/>
  297.  
  298.              </div></td>
  299.  
  300.          </tr>
  301.  
  302.          <tr bgcolor="#F4FFF4">
  303.  
  304.            <td bordercolor="#FFFFFF"><div align="left">design</div></td>
  305.  
  306.            <td bordercolor="#FFFFFF"> <div align="left">
  307.  
  308.                <input name="design" type="checkbox"  class="textstyle" id="design" value="yes"/>
  309.  
  310.              </div></td>
  311.  
  312.            <td bordercolor="#FFFFFF"><div align="left">semi-detached</div></td>
  313.  
  314.            <td bordercolor="#FFFFFF"><div align="right">
  315.  
  316.                <input name="semidetached" type="checkbox"  class="textstyle" id="semidetached" value="yes"/>
  317.  
  318.              </div></td>
  319.  
  320.          </tr>
  321.  
  322.          <tr bgcolor="#F4FFF4">
  323.  
  324.            <td bordercolor="#FFFFFF"><div align="left">lifestyle</div></td>
  325.  
  326.            <td bordercolor="#FFFFFF"> <div align="left">
  327.  
  328.                <input name="lifestyle" type="checkbox"  class="textstyle" id="lifestyle" value="yes"/>
  329.  
  330.              </div></td>
  331.  
  332.            <td bordercolor="#FFFFFF"><div align="left">aged</div></td>
  333.  
  334.            <td bordercolor="#FFFFFF"><div align="right">
  335.  
  336.                <input name="aged" type="checkbox"  class="textstyle" id="aged" value="yes"/>
  337.  
  338.              </div></td>
  339.  
  340.          </tr>
  341.  
  342.          <tr bgcolor="#F4FFF4">
  343.  
  344.            <td bordercolor="#FFFFFF"><div align="left">structural</div></td>
  345.  
  346.            <td bordercolor="#FFFFFF"> <div align="left">
  347.  
  348.                <input name="structural" type="checkbox"  class="textstyle" id="structural" value="yes"/>
  349.  
  350.              </div></td>
  351.  
  352.            <td bordercolor="#FFFFFF"><div align="left">allergy</div></td>
  353.  
  354.            <td bordercolor="#FFFFFF"><div align="right">
  355.  
  356.                <input name="allergy" type="checkbox"  class="textstyle" id="allergy" value="yes"/>
  357.  
  358.              </div></td>
  359.  
  360.          </tr>
  361.  
  362.          <tr bgcolor="#F4FFF4">
  363.  
  364.            <td bordercolor="#FFFFFF"><div align="left">planning</div></td>
  365.  
  366.            <td bordercolor="#FFFFFF"> <div align="left">
  367.  
  368.                <input name="planning" type="checkbox"  class="textstyle" id="planning" value="yes"/>
  369.  
  370.              </div></td>
  371.  
  372.            <td bordercolor="#FFFFFF"><div align="left">detached</div></td>
  373.  
  374.            <td bordercolor="#FFFFFF"><div align="right">
  375.  
  376.                <input name="detached" type="checkbox"  class="textstyle" id="detached" value="yes"/>
  377.  
  378.              </div></td>
  379.  
  380.          </tr>
  381.  
  382.          <tr bgcolor="#F4FFF4">
  383.  
  384.            <td bordercolor="#FFFFFF"><div align="left">building regs</div></td>
  385.  
  386.            <td bordercolor="#FFFFFF"> <div align="left">
  387.  
  388.                <input name="buildingregs" type="checkbox"  class="textstyle" id="buildingregs" value="yes"/>
  389.  
  390.              </div></td>
  391.  
  392.            <td bordercolor="#FFFFFF"><div align="left">other</div></td>
  393.  
  394.            <td bordercolor="#FFFFFF"><div align="right">
  395.  
  396.                <input name="otherneeds" type="checkbox"  class="textstyle" id="otherneeds" value="yes"/>
  397.  
  398.              </div></td>
  399.  
  400.          </tr>
  401.  
  402.          <tr bgcolor="#F4FFF4">
  403.  
  404.            <td bordercolor="#FFFFFF"><div align="left">other </div></td>
  405.  
  406.            <td bordercolor="#FFFFFF"> <div align="left">
  407.  
  408.                <input name="otherhelp" type="text"  class="textstyle" id="otherhelp" size="15"/>
  409.  
  410.              </div></td>
  411.  
  412.            <td bordercolor="#FFFFFF"><div align="left">please specify </div></td>
  413.  
  414.            <td bordercolor="#FFFFFF"><div align="right">
  415.  
  416.                <input name="specifyneeds" type="text"  class="textstyle" id="specifyneeds" size="15"/>
  417.  
  418.              </div></td>
  419.  
  420.          </tr>
  421.  
  422.        </table>
  423.  
  424.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
  425.  
  426.          <tr bgcolor="#305A36">
  427.  
  428.            <td height="24" colspan="4" class="boldtext"><div align="center" class="stylewht">Customer
  429.  
  430.                Preferences</div></td>
  431.  
  432.          </tr>
  433.  
  434.          <tr>
  435.  
  436.            <td width="23%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>months</strong></div></td>
  437.  
  438.            <td width="24%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">1</div></td>
  439.  
  440.            <td width="30%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">6</div></td>
  441.  
  442.            <td width="22%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">9</div></td>
  443.  
  444.          </tr>
  445.  
  446.          <tr>
  447.  
  448.            <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">program
  449.  
  450.                time completion</div></td>
  451.  
  452.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  453.  
  454.                <input type="radio" name="programtimecompletion" value="1month" />
  455.  
  456.              </div></td>
  457.  
  458.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  459.  
  460.                <input type="radio" name="programtimecompletion" value="6months" />
  461.  
  462.              </div></td>
  463.  
  464.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  465.  
  466.                <input type="radio" name="programtimecompletion" value="9months" />
  467.  
  468.              </div></td>
  469.  
  470.          </tr>
  471.  
  472.          <tr>
  473.  
  474.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>k=1000</strong></div></td>
  475.  
  476.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">3k
  477.  
  478.                - 15k</div></td>
  479.  
  480.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">18k
  481.  
  482.                - 45k</div></td>
  483.  
  484.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">&nbsp;
  485.  
  486.                &gt; 50k</div></td>
  487.  
  488.          </tr>
  489.  
  490.          <tr>
  491.  
  492.            <td height="19" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">budget
  493.  
  494.                cost</div></td>
  495.  
  496.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  497.  
  498.                <input type="radio" name="budgetcost" value="3kto15k" />
  499.  
  500.              </div></td>
  501.  
  502.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  503.  
  504.                <input type="radio" name="budgetcost" value="18kto45k" />
  505.  
  506.              </div></td>
  507.  
  508.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  509.  
  510.                <input type="radio" name="budgetcost" value="over50k" />
  511.  
  512.              </div></td>
  513.  
  514.          </tr>
  515.  
  516.          <tr>
  517.  
  518.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
  519.  
  520.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">low</div></td>
  521.  
  522.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">medium</div></td>
  523.  
  524.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">high</div></td>
  525.  
  526.          </tr>
  527.  
  528.          <tr>
  529.  
  530.            <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">project
  531.  
  532.                deadline<br />
  533.  
  534.              </div></td>
  535.  
  536.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  537.  
  538.                <input type="radio" name="projectdeadline" value="low" />
  539.  
  540.              </div></td>
  541.  
  542.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  543.  
  544.                <input type="radio" name="projectdeadline" value="medium" />
  545.  
  546.              </div></td>
  547.  
  548.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  549.  
  550.                <input type="radio" name="projectdeadline" value="high" />
  551.  
  552.              </div></td>
  553.  
  554.          </tr>
  555.  
  556.          <tr>
  557.  
  558.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
  559.  
  560.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  561.  
  562.                rent</div></td>
  563.  
  564.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  565.  
  566.                sell</div></td>
  567.  
  568.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  569.  
  570.                keep</div></td>
  571.  
  572.          </tr>
  573.  
  574.          <tr>
  575.  
  576.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2">why build</td>
  577.  
  578.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  579.  
  580.                <input type="radio" name="whybuild" value="rent" />
  581.  
  582.              </div></td>
  583.  
  584.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  585.  
  586.                <input type="radio" name="whybuild" value="sell" />
  587.  
  588.              </div></td>
  589.  
  590.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  591.  
  592.                <input type="radio" name="whybuild" value="keep" />
  593.  
  594.              </div></td>
  595.  
  596.          </tr>
  597.  
  598.        </table>
  599.  
  600.        <table width="100%" border="0" cellpadding="4" cellspacing="0" class="textstyle">
  601.  
  602.          <tr bgcolor="#F2FFF2">
  603.  
  604.            <td width="25%">any other notes</td>
  605.  
  606.            <td width="75%" bgcolor="#F2FFF2"><textarea name="otherpreferences" cols="40" class="textstyle" id="otherpreferences"></textarea></td>
  607.  
  608.          </tr>
  609.  
  610.        </table>  <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
  611.  
  612.          <tr bgcolor="#F2FFF2">
  613.  
  614.            <td width="49%"><div align="right">
  615.  
  616.                <input type="submit" name="submit" value="submit" class="textstyle"/>
  617.  
  618.              </div></td>
  619.  
  620.            <td width="2%">&nbsp;</td>
  621.  
  622.            <td width="49%"><input name="reset" type="reset" id="reset" value="reset" class="textstyle" /></td>
  623.  
  624.          </tr>
  625.  
  626.        </table>
  627.  
  628.      </form></td>
  629.  
  630.  </tr>
  631.  
  632. </table>';
  633.  
  634. return $strOut;
  635.  
  636. }
  637.  
  638.  
  639.  
  640. ?>
  641.  
  642.  


Okay so mix them all together and you should get a validation! Any hassles give me a shout.

Good Luck
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

http://www.buildingdoctors.co.uk/getsta ... mtrial.php

as you can see it is blank. LOL

it will work soon but for now it seems that some little bit of info is either missing or shouldnt be there. more than likely it is missing
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

You are going to have to set the 'a' value in the form action to get the page to do anything

action="filename.php?a=1"

I don't work with the global variables enabled and submit has never been a valide index for me so I use that as a work around
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i am not sure but there maybe something wrong with the printform.php, its printing out the error message "you need to fill in these fields" before any fields have been filled in. plus when it lets you know what fields are filled in. if you missed 3 fields to fill in, it lets you know but then it erases what you have filled in and you have to start again.

take a look and see what i mean

"http://www.buildingdoctors.co.uk/getstartedformtrial2.php?a=1"
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

PHP Code: [ Select ]
if ($action == 1) {
 
   for($i=0;$i<count($required_fields);$i++) {
 
        if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
            $err[$errCount]    ='You must provide '.$field_errors[$i];
 
            $errCount         = $errCount + 1;
 
        }else{
 
            $field[$fineCount]     = $_POST[$required_fields[$i]];
 
            $fineCount            = $fineCount + 1;
 
        }
 
    }
  1. if ($action == 1) {
  2.  
  3.    for($i=0;$i<count($required_fields);$i++) {
  4.  
  5.         if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  6.  
  7.             $err[$errCount]    ='You must provide '.$field_errors[$i];
  8.  
  9.             $errCount         = $errCount + 1;
  10.  
  11.         }else{
  12.  
  13.             $field[$fineCount]     = $_POST[$required_fields[$i]];
  14.  
  15.             $fineCount            = $fineCount + 1;
  16.  
  17.         }
  18.  
  19.     }


this means that if getstartedformtrial.php?a=1 is typed then it will show the form with the submission errors at the top. instead the errors should come after the submit button is pressed. so can the code be this instead:

PHP Code: [ Select ]
if ($action == {$_POST['submit']}) {
 
   for($i=0;$i<count($required_fields);$i++) {
 
        if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
            $err[$errCount]    ='You must provide '.$field_errors[$i];
 
            $errCount         = $errCount + 1;
 
        }else{
 
            $field[$fineCount]     = $_POST[$required_fields[$i]];
 
            $fineCount            = $fineCount + 1;
 
        }
 
    }
  1. if ($action == {$_POST['submit']}) {
  2.  
  3.    for($i=0;$i<count($required_fields);$i++) {
  4.  
  5.         if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  6.  
  7.             $err[$errCount]    ='You must provide '.$field_errors[$i];
  8.  
  9.             $errCount         = $errCount + 1;
  10.  
  11.         }else{
  12.  
  13.             $field[$fineCount]     = $_POST[$required_fields[$i]];
  14.  
  15.             $fineCount            = $fineCount + 1;
  16.  
  17.         }
  18.  
  19.     }


or

PHP Code: [ Select ]
if ($action == 'submit') {
 
   for($i=0;$i<count($required_fields);$i++) {
 
        if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
 
            $err[$errCount]    ='You must provide '.$field_errors[$i];
 
            $errCount         = $errCount + 1;
 
        }else{
 
            $field[$fineCount]     = $_POST[$required_fields[$i]];
 
            $fineCount            = $fineCount + 1;
 
        }
 
    }
  1. if ($action == 'submit') {
  2.  
  3.    for($i=0;$i<count($required_fields);$i++) {
  4.  
  5.         if(!isset($_POST[$required_fields[$i]]) || $_POST[$required_fields[$i]]=='') {
  6.  
  7.             $err[$errCount]    ='You must provide '.$field_errors[$i];
  8.  
  9.             $errCount         = $errCount + 1;
  10.  
  11.         }else{
  12.  
  13.             $field[$fineCount]     = $_POST[$required_fields[$i]];
  14.  
  15.             $fineCount            = $fineCount + 1;
  16.  
  17.         }
  18.  
  19.     }


or something that would allow the errors to show only after submission
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Sorry I forgot to add a print statement before form ie

print $form

at the last else. That is why the form is not showing up unless you have a=1 - sorry

Okay when you link to the page for the first time just use
filename.php. Don't add anything, the a=1 will be added when the form is submitted.

Let's get this right then we can deal with the other issues on the page
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

ok, when i input the getstartedformtrial2.php for the first time it just hangs:
'http://www.buildingdoctors.co.uk/getstartedformtrial2.php'


this page comes up with errors
http://www.buildingdoctors.co.uk/getsta ... l2.php?a=1
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

can there be some sort of if statement in the printForm file whereby the condition would be "IF form is submitted then check for errors ELSE $strOut. i dont know how to put it in code tho
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Go and check the posting on page one. I habve fixed it so that the page works correctly.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

ok, brill. the form works now. ok. can we deal with the refresh factor. is there a way we can take that out because ppl would like to fill in fields that are not filled in rather than have to go back and fill out the whole form. plus check out the form. its quite a long one. lol. but at least it works now
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Okat tell you what, go to yhe printForm function and inside the HTML string, mark the fields that are required with an '*' then once that is done I will have a look at the refresh problem - okay?
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

PHP Code: [ Select ]
 
<html>
 
<head>
 
<title>Untitled Document</title>
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
</head>
 
 
 
<body>
 
<?php
 
function printForm($err = ""){
 
$strOut = '<body leftmargin="0" topmargin="0">
 
<table width="400"  height="246" border="0" cellpadding="0" cellspacing="0" class="biggertext">
 
 <tr>
 
   <td height="30" valign="top"><form method="POST" action="getstartedformtrial2.php?a=1">
 
      <table width="400" border="0" cellspacing="0" cellpadding="4">
 
         <tr>
 
           <td align="center"><img src="images/cr_header.gif" width="404" height="55" /></td>
 
         </tr>
 
       </table>
 
       <table width="400" border="0" cellspacing="0" cellpadding="4">
 
         <tr>
 
           <td align="left">'.$err.'</td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
 
         <tr bgcolor="#305A36">
 
           <td height="24" colspan="2" class="boldtext"><div align="center" class="stylewht">personal
 
               details </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">' //the required fields are marked in the "name" part of the "input". they mainly are radio buttons plus the top details regarding personla details
 
            '<td width="199">name:<br /> <input type="text" name="name*"  id="name" class="textstyle" /></td>
 
           <td width="199">email: <br /> <input type="text" name="email*" id="email" class="textstyle"/></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td rowspan="2">contact address:
 
             <textarea name="contactaddress" cols="20" rows="2" id="contactaddress"></textarea></td>
 
           <td>mobile:<br /> <input name="mobile*" type="text" class="textstyle" id="mobile"/></td>
 
         </tr>
 
         <tr>
 
           <td bgcolor="#F4FFF4">work/home tel:
 
             <input name="workhometel*" type="text" class="textstyle" id="workhometel"/></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td>contact postcode:<br /> <input name="contactpostcode*" type="text" class="textstyle" id="contactpostcode" /></td>
 
           <td bgcolor="#F4FFF4">project postcode: <br /> <input name="projectpostcode*" type="text" class="textstyle" id="projectpostcode"/>
 
           </td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
 
         <tr bgcolor="#F4FFF4">
 
           <td width="20%">do you need</td>
 
           <td width="26%"><div align="right">refurb
 
               <input type="radio" name="doyouneed*" value="refurb" />
 
             </div></td>
 
           <td width="30%"><div align="right">extra space
 
               <input type="radio" name="doyouneed*" value="extraspace" />
 
             </div></td>
 
           <td width="24%"><div align="right">extra light
 
               <input type="radio" name="doyouneed*" value="extralight" />
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td>design style</td>
 
           <td><div align="right">contemp\'ry
 
               <input type="radio" name="designstyle*" value="contemporary" />
 
             </div></td>
 
           <td><div align="right">traditional
 
               <input type="radio" name="designstyle*" value="traditional" />
 
             </div></td>
 
           <td><div align="right">mixed
 
               <input type="radio" name="designstyle*" value="mixed" />
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
 
         <tr bgcolor="#F4FFF4">
 
           <td colspan="5">&nbsp;</td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td width="20%">project</td>
 
           <td width="19%"><div align="right">garden
 
               <input type="radio" name="project*" value="garden" />
 
             </div></td>
 
           <td width="18%"><div align="right">loft
 
               <input type="radio" name="project*" value="loft" />
 
             </div></td>
 
           <td width="17%"><div align="right">refit
 
               <input type="radio" name="project*" value="refit" />
 
             </div></td>
 
           <td width="26%"><div align="right">extension
 
               <input type="radio" name="project*" value="extension" />
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td>use</td>
 
           <td><div align="right">shop
 
               <input type="radio" name="uses*" value="shop" />
 
             </div></td>
 
           <td><div align="right">office
 
               <input type="radio" name="uses*" value="office" />
 
             </div></td>
 
           <td><div align="right">home
 
               <input type="radio" name="uses*" value="home" />
 
             </div></td>
 
           <td><div align="right">other
 
               <input type="radio" name="uses*" value="other" />
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
 
         <tr>
 
           <td height="24" colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">type
 
               of help required</div></td>
 
           <td colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">special
 
               needs</div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td width="22%" bordercolor="#FFFFFF"><div align="left">engineer</div></td>
 
           <td width="24%" bordercolor="#FFFFFF" bgcolor="#F4FFF4"> <div align="left">
 
               <input name="engineer" type="checkbox"  class="textstyle" id="engineer" value="yes"/>
 
             </div></td>
 
           <td width="30%" bordercolor="#FFFFFF"><div align="left">Wheelchair
 
               ecology</div></td>
 
           <td width="24%" bordercolor="#FFFFFF"><div align="right">
 
               <input name="wheelchair" type="checkbox"  class="textstyle" id="wheelchair" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">party wall</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="partywall" type="checkbox"  class="textstyle" id="partywall2" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">Partial eyesight</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="partialeyesight" type="checkbox"  class="textstyle" id="partialeyesight" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">architect</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="architect" type="checkbox"  class="textstyle" id="architect" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">terraced</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="terraced" type="checkbox"  class="textstyle" id="terraced" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td height="33" bordercolor="#FFFFFF"><div align="left">project manager</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="projectmanager" type="checkbox"  class="textstyle" id="projectmanager" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">family &amp; <br />
 
               children</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="familychildern" type="checkbox"  class="textstyle" id="familychildern" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">design</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="design" type="checkbox"  class="textstyle" id="design" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">semi-detached</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="semidetached" type="checkbox"  class="textstyle" id="semidetached" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">lifestyle</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="lifestyle" type="checkbox"  class="textstyle" id="lifestyle" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">aged</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="aged" type="checkbox"  class="textstyle" id="aged" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">structural</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="structural" type="checkbox"  class="textstyle" id="structural" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">allergy</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="allergy" type="checkbox"  class="textstyle" id="allergy" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">planning</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="planning" type="checkbox"  class="textstyle" id="planning" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">detached</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="detached" type="checkbox"  class="textstyle" id="detached" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">building regs</div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="buildingregs" type="checkbox"  class="textstyle" id="buildingregs" value="yes"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">other</div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="otherneeds" type="checkbox"  class="textstyle" id="otherneeds" value="yes"/>
 
             </div></td>
 
         </tr>
 
         <tr bgcolor="#F4FFF4">
 
           <td bordercolor="#FFFFFF"><div align="left">other </div></td>
 
           <td bordercolor="#FFFFFF"> <div align="left">
 
               <input name="otherhelp" type="text"  class="textstyle" id="otherhelp" size="15"/>
 
             </div></td>
 
           <td bordercolor="#FFFFFF"><div align="left">please specify </div></td>
 
           <td bordercolor="#FFFFFF"><div align="right">
 
               <input name="specifyneeds" type="text"  class="textstyle" id="specifyneeds" size="15"/>
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
 
         <tr bgcolor="#305A36">
 
           <td height="24" colspan="4" class="boldtext"><div align="center" class="stylewht">Customer
 
               Preferences</div></td>
 
         </tr>
 
         <tr>
 
           <td width="23%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>months</strong></div></td>
 
           <td width="24%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">1</div></td>
 
           <td width="30%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">6</div></td>
 
           <td width="22%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">9</div></td>
 
         </tr>
 
         <tr>
 
           <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">program
 
               time completion</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="programtimecompletion*" value="1month" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="programtimecompletion*" value="6months" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="programtimecompletion*" value="9months" />
 
             </div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>k=1000</strong></div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">3k
 
               - 15k</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">18k
 
               - 45k</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">&nbsp;
 
               &gt; 50k</div></td>
 
         </tr>
 
         <tr>
 
           <td height="19" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">budget
 
               cost</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="budgetcost*" value="3kto15k" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="budgetcost*" value="18kto45k" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="budgetcost*" value="over50k" />
 
             </div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">low</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">medium</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">high</div></td>
 
         </tr>
 
         <tr>
 
           <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">project
 
               deadline<br />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="projectdeadline*" value="low" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="projectdeadline*" value="medium" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="projectdeadline*" value="high" />
 
             </div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
 
               rent</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
 
               sell</div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
 
               keep</div></td>
 
         </tr>
 
         <tr>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2">why build</td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="whybuild*" value="rent" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="whybuild*" value="sell" />
 
             </div></td>
 
           <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
 
               <input type="radio" name="whybuild*" value="keep" />
 
             </div></td>
 
         </tr>
 
       </table>
 
       <table width="100%" border="0" cellpadding="4" cellspacing="0" class="textstyle">
 
         <tr bgcolor="#F2FFF2">
 
           <td width="25%">any other notes</td>
 
           <td width="75%" bgcolor="#F2FFF2"><textarea name="otherpreferences" cols="40" class="textstyle" id="otherpreferences"></textarea></td>
 
         </tr>
 
       </table>  <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
 
         <tr bgcolor="#F2FFF2">
 
           <td width="49%"><div align="right">
 
               <input type="submit" name="submit" value="submit" class="textstyle"/>
 
             </div></td>
 
           <td width="2%">&nbsp;</td>
 
           <td width="49%"><input name="reset" type="reset" id="reset" value="reset" class="textstyle" /></td>
 
         </tr>
 
       </table>
 
     </form></td>
 
 </tr>
 
</table>';
 
return $strOut;
 
}
 
 
 
?>
 
</body>
 
</html>
 
 
 
 
  1.  
  2. <html>
  3.  
  4. <head>
  5.  
  6. <title>Untitled Document</title>
  7.  
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  9.  
  10. </head>
  11.  
  12.  
  13.  
  14. <body>
  15.  
  16. <?php
  17.  
  18. function printForm($err = ""){
  19.  
  20. $strOut = '<body leftmargin="0" topmargin="0">
  21.  
  22. <table width="400"  height="246" border="0" cellpadding="0" cellspacing="0" class="biggertext">
  23.  
  24.  <tr>
  25.  
  26.    <td height="30" valign="top"><form method="POST" action="getstartedformtrial2.php?a=1">
  27.  
  28.       <table width="400" border="0" cellspacing="0" cellpadding="4">
  29.  
  30.          <tr>
  31.  
  32.            <td align="center"><img src="images/cr_header.gif" width="404" height="55" /></td>
  33.  
  34.          </tr>
  35.  
  36.        </table>
  37.  
  38.        <table width="400" border="0" cellspacing="0" cellpadding="4">
  39.  
  40.          <tr>
  41.  
  42.            <td align="left">'.$err.'</td>
  43.  
  44.          </tr>
  45.  
  46.        </table>
  47.  
  48.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  49.  
  50.          <tr bgcolor="#305A36">
  51.  
  52.            <td height="24" colspan="2" class="boldtext"><div align="center" class="stylewht">personal
  53.  
  54.                details </div></td>
  55.  
  56.          </tr>
  57.  
  58.          <tr bgcolor="#F4FFF4">' //the required fields are marked in the "name" part of the "input". they mainly are radio buttons plus the top details regarding personla details
  59.  
  60.             '<td width="199">name:<br /> <input type="text" name="name*"  id="name" class="textstyle" /></td>
  61.  
  62.            <td width="199">email: <br /> <input type="text" name="email*" id="email" class="textstyle"/></td>
  63.  
  64.          </tr>
  65.  
  66.          <tr bgcolor="#F4FFF4">
  67.  
  68.            <td rowspan="2">contact address:
  69.  
  70.              <textarea name="contactaddress" cols="20" rows="2" id="contactaddress"></textarea></td>
  71.  
  72.            <td>mobile:<br /> <input name="mobile*" type="text" class="textstyle" id="mobile"/></td>
  73.  
  74.          </tr>
  75.  
  76.          <tr>
  77.  
  78.            <td bgcolor="#F4FFF4">work/home tel:
  79.  
  80.              <input name="workhometel*" type="text" class="textstyle" id="workhometel"/></td>
  81.  
  82.          </tr>
  83.  
  84.          <tr bgcolor="#F4FFF4">
  85.  
  86.            <td>contact postcode:<br /> <input name="contactpostcode*" type="text" class="textstyle" id="contactpostcode" /></td>
  87.  
  88.            <td bgcolor="#F4FFF4">project postcode: <br /> <input name="projectpostcode*" type="text" class="textstyle" id="projectpostcode"/>
  89.  
  90.            </td>
  91.  
  92.          </tr>
  93.  
  94.        </table>
  95.  
  96.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  97.  
  98.          <tr bgcolor="#F4FFF4">
  99.  
  100.            <td width="20%">do you need</td>
  101.  
  102.            <td width="26%"><div align="right">refurb
  103.  
  104.                <input type="radio" name="doyouneed*" value="refurb" />
  105.  
  106.              </div></td>
  107.  
  108.            <td width="30%"><div align="right">extra space
  109.  
  110.                <input type="radio" name="doyouneed*" value="extraspace" />
  111.  
  112.              </div></td>
  113.  
  114.            <td width="24%"><div align="right">extra light
  115.  
  116.                <input type="radio" name="doyouneed*" value="extralight" />
  117.  
  118.              </div></td>
  119.  
  120.          </tr>
  121.  
  122.          <tr bgcolor="#F4FFF4">
  123.  
  124.            <td>design style</td>
  125.  
  126.            <td><div align="right">contemp\'ry
  127.  
  128.                <input type="radio" name="designstyle*" value="contemporary" />
  129.  
  130.              </div></td>
  131.  
  132.            <td><div align="right">traditional
  133.  
  134.                <input type="radio" name="designstyle*" value="traditional" />
  135.  
  136.              </div></td>
  137.  
  138.            <td><div align="right">mixed
  139.  
  140.                <input type="radio" name="designstyle*" value="mixed" />
  141.  
  142.              </div></td>
  143.  
  144.          </tr>
  145.  
  146.        </table>
  147.  
  148.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" class="textstyle">
  149.  
  150.          <tr bgcolor="#F4FFF4">
  151.  
  152.            <td colspan="5">&nbsp;</td>
  153.  
  154.          </tr>
  155.  
  156.          <tr bgcolor="#F4FFF4">
  157.  
  158.            <td width="20%">project</td>
  159.  
  160.            <td width="19%"><div align="right">garden
  161.  
  162.                <input type="radio" name="project*" value="garden" />
  163.  
  164.              </div></td>
  165.  
  166.            <td width="18%"><div align="right">loft
  167.  
  168.                <input type="radio" name="project*" value="loft" />
  169.  
  170.              </div></td>
  171.  
  172.            <td width="17%"><div align="right">refit
  173.  
  174.                <input type="radio" name="project*" value="refit" />
  175.  
  176.              </div></td>
  177.  
  178.            <td width="26%"><div align="right">extension
  179.  
  180.                <input type="radio" name="project*" value="extension" />
  181.  
  182.              </div></td>
  183.  
  184.          </tr>
  185.  
  186.          <tr bgcolor="#F4FFF4">
  187.  
  188.            <td>use</td>
  189.  
  190.            <td><div align="right">shop
  191.  
  192.                <input type="radio" name="uses*" value="shop" />
  193.  
  194.              </div></td>
  195.  
  196.            <td><div align="right">office
  197.  
  198.                <input type="radio" name="uses*" value="office" />
  199.  
  200.              </div></td>
  201.  
  202.            <td><div align="right">home
  203.  
  204.                <input type="radio" name="uses*" value="home" />
  205.  
  206.              </div></td>
  207.  
  208.            <td><div align="right">other
  209.  
  210.                <input type="radio" name="uses*" value="other" />
  211.  
  212.              </div></td>
  213.  
  214.          </tr>
  215.  
  216.        </table>
  217.  
  218.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
  219.  
  220.          <tr>
  221.  
  222.            <td height="24" colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">type
  223.  
  224.                of help required</div></td>
  225.  
  226.            <td colspan="2" bgcolor="#305A36" class="boldtext"><div align="center" class="stylewht">special
  227.  
  228.                needs</div></td>
  229.  
  230.          </tr>
  231.  
  232.          <tr bgcolor="#F4FFF4">
  233.  
  234.            <td width="22%" bordercolor="#FFFFFF"><div align="left">engineer</div></td>
  235.  
  236.            <td width="24%" bordercolor="#FFFFFF" bgcolor="#F4FFF4"> <div align="left">
  237.  
  238.                <input name="engineer" type="checkbox"  class="textstyle" id="engineer" value="yes"/>
  239.  
  240.              </div></td>
  241.  
  242.            <td width="30%" bordercolor="#FFFFFF"><div align="left">Wheelchair
  243.  
  244.                ecology</div></td>
  245.  
  246.            <td width="24%" bordercolor="#FFFFFF"><div align="right">
  247.  
  248.                <input name="wheelchair" type="checkbox"  class="textstyle" id="wheelchair" value="yes"/>
  249.  
  250.              </div></td>
  251.  
  252.          </tr>
  253.  
  254.          <tr bgcolor="#F4FFF4">
  255.  
  256.            <td bordercolor="#FFFFFF"><div align="left">party wall</div></td>
  257.  
  258.            <td bordercolor="#FFFFFF"> <div align="left">
  259.  
  260.                <input name="partywall" type="checkbox"  class="textstyle" id="partywall2" value="yes"/>
  261.  
  262.              </div></td>
  263.  
  264.            <td bordercolor="#FFFFFF"><div align="left">Partial eyesight</div></td>
  265.  
  266.            <td bordercolor="#FFFFFF"><div align="right">
  267.  
  268.                <input name="partialeyesight" type="checkbox"  class="textstyle" id="partialeyesight" value="yes"/>
  269.  
  270.              </div></td>
  271.  
  272.          </tr>
  273.  
  274.          <tr bgcolor="#F4FFF4">
  275.  
  276.            <td bordercolor="#FFFFFF"><div align="left">architect</div></td>
  277.  
  278.            <td bordercolor="#FFFFFF"> <div align="left">
  279.  
  280.                <input name="architect" type="checkbox"  class="textstyle" id="architect" value="yes"/>
  281.  
  282.              </div></td>
  283.  
  284.            <td bordercolor="#FFFFFF"><div align="left">terraced</div></td>
  285.  
  286.            <td bordercolor="#FFFFFF"><div align="right">
  287.  
  288.                <input name="terraced" type="checkbox"  class="textstyle" id="terraced" value="yes"/>
  289.  
  290.              </div></td>
  291.  
  292.          </tr>
  293.  
  294.          <tr bgcolor="#F4FFF4">
  295.  
  296.            <td height="33" bordercolor="#FFFFFF"><div align="left">project manager</div></td>
  297.  
  298.            <td bordercolor="#FFFFFF"> <div align="left">
  299.  
  300.                <input name="projectmanager" type="checkbox"  class="textstyle" id="projectmanager" value="yes"/>
  301.  
  302.              </div></td>
  303.  
  304.            <td bordercolor="#FFFFFF"><div align="left">family &amp; <br />
  305.  
  306.                children</div></td>
  307.  
  308.            <td bordercolor="#FFFFFF"><div align="right">
  309.  
  310.                <input name="familychildern" type="checkbox"  class="textstyle" id="familychildern" value="yes"/>
  311.  
  312.              </div></td>
  313.  
  314.          </tr>
  315.  
  316.          <tr bgcolor="#F4FFF4">
  317.  
  318.            <td bordercolor="#FFFFFF"><div align="left">design</div></td>
  319.  
  320.            <td bordercolor="#FFFFFF"> <div align="left">
  321.  
  322.                <input name="design" type="checkbox"  class="textstyle" id="design" value="yes"/>
  323.  
  324.              </div></td>
  325.  
  326.            <td bordercolor="#FFFFFF"><div align="left">semi-detached</div></td>
  327.  
  328.            <td bordercolor="#FFFFFF"><div align="right">
  329.  
  330.                <input name="semidetached" type="checkbox"  class="textstyle" id="semidetached" value="yes"/>
  331.  
  332.              </div></td>
  333.  
  334.          </tr>
  335.  
  336.          <tr bgcolor="#F4FFF4">
  337.  
  338.            <td bordercolor="#FFFFFF"><div align="left">lifestyle</div></td>
  339.  
  340.            <td bordercolor="#FFFFFF"> <div align="left">
  341.  
  342.                <input name="lifestyle" type="checkbox"  class="textstyle" id="lifestyle" value="yes"/>
  343.  
  344.              </div></td>
  345.  
  346.            <td bordercolor="#FFFFFF"><div align="left">aged</div></td>
  347.  
  348.            <td bordercolor="#FFFFFF"><div align="right">
  349.  
  350.                <input name="aged" type="checkbox"  class="textstyle" id="aged" value="yes"/>
  351.  
  352.              </div></td>
  353.  
  354.          </tr>
  355.  
  356.          <tr bgcolor="#F4FFF4">
  357.  
  358.            <td bordercolor="#FFFFFF"><div align="left">structural</div></td>
  359.  
  360.            <td bordercolor="#FFFFFF"> <div align="left">
  361.  
  362.                <input name="structural" type="checkbox"  class="textstyle" id="structural" value="yes"/>
  363.  
  364.              </div></td>
  365.  
  366.            <td bordercolor="#FFFFFF"><div align="left">allergy</div></td>
  367.  
  368.            <td bordercolor="#FFFFFF"><div align="right">
  369.  
  370.                <input name="allergy" type="checkbox"  class="textstyle" id="allergy" value="yes"/>
  371.  
  372.              </div></td>
  373.  
  374.          </tr>
  375.  
  376.          <tr bgcolor="#F4FFF4">
  377.  
  378.            <td bordercolor="#FFFFFF"><div align="left">planning</div></td>
  379.  
  380.            <td bordercolor="#FFFFFF"> <div align="left">
  381.  
  382.                <input name="planning" type="checkbox"  class="textstyle" id="planning" value="yes"/>
  383.  
  384.              </div></td>
  385.  
  386.            <td bordercolor="#FFFFFF"><div align="left">detached</div></td>
  387.  
  388.            <td bordercolor="#FFFFFF"><div align="right">
  389.  
  390.                <input name="detached" type="checkbox"  class="textstyle" id="detached" value="yes"/>
  391.  
  392.              </div></td>
  393.  
  394.          </tr>
  395.  
  396.          <tr bgcolor="#F4FFF4">
  397.  
  398.            <td bordercolor="#FFFFFF"><div align="left">building regs</div></td>
  399.  
  400.            <td bordercolor="#FFFFFF"> <div align="left">
  401.  
  402.                <input name="buildingregs" type="checkbox"  class="textstyle" id="buildingregs" value="yes"/>
  403.  
  404.              </div></td>
  405.  
  406.            <td bordercolor="#FFFFFF"><div align="left">other</div></td>
  407.  
  408.            <td bordercolor="#FFFFFF"><div align="right">
  409.  
  410.                <input name="otherneeds" type="checkbox"  class="textstyle" id="otherneeds" value="yes"/>
  411.  
  412.              </div></td>
  413.  
  414.          </tr>
  415.  
  416.          <tr bgcolor="#F4FFF4">
  417.  
  418.            <td bordercolor="#FFFFFF"><div align="left">other </div></td>
  419.  
  420.            <td bordercolor="#FFFFFF"> <div align="left">
  421.  
  422.                <input name="otherhelp" type="text"  class="textstyle" id="otherhelp" size="15"/>
  423.  
  424.              </div></td>
  425.  
  426.            <td bordercolor="#FFFFFF"><div align="left">please specify </div></td>
  427.  
  428.            <td bordercolor="#FFFFFF"><div align="right">
  429.  
  430.                <input name="specifyneeds" type="text"  class="textstyle" id="specifyneeds" size="15"/>
  431.  
  432.              </div></td>
  433.  
  434.          </tr>
  435.  
  436.        </table>
  437.  
  438.        <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#F5F5F5" class="textstyle">
  439.  
  440.          <tr bgcolor="#305A36">
  441.  
  442.            <td height="24" colspan="4" class="boldtext"><div align="center" class="stylewht">Customer
  443.  
  444.                Preferences</div></td>
  445.  
  446.          </tr>
  447.  
  448.          <tr>
  449.  
  450.            <td width="23%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>months</strong></div></td>
  451.  
  452.            <td width="24%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">1</div></td>
  453.  
  454.            <td width="30%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">6</div></td>
  455.  
  456.            <td width="22%" bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">9</div></td>
  457.  
  458.          </tr>
  459.  
  460.          <tr>
  461.  
  462.            <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">program
  463.  
  464.                time completion</div></td>
  465.  
  466.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  467.  
  468.                <input type="radio" name="programtimecompletion*" value="1month" />
  469.  
  470.              </div></td>
  471.  
  472.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  473.  
  474.                <input type="radio" name="programtimecompletion*" value="6months" />
  475.  
  476.              </div></td>
  477.  
  478.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  479.  
  480.                <input type="radio" name="programtimecompletion*" value="9months" />
  481.  
  482.              </div></td>
  483.  
  484.          </tr>
  485.  
  486.          <tr>
  487.  
  488.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"><strong>k=1000</strong></div></td>
  489.  
  490.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">3k
  491.  
  492.                - 15k</div></td>
  493.  
  494.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">18k
  495.  
  496.                - 45k</div></td>
  497.  
  498.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">&nbsp;
  499.  
  500.                &gt; 50k</div></td>
  501.  
  502.          </tr>
  503.  
  504.          <tr>
  505.  
  506.            <td height="19" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">budget
  507.  
  508.                cost</div></td>
  509.  
  510.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  511.  
  512.                <input type="radio" name="budgetcost*" value="3kto15k" />
  513.  
  514.              </div></td>
  515.  
  516.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  517.  
  518.                <input type="radio" name="budgetcost*" value="18kto45k" />
  519.  
  520.              </div></td>
  521.  
  522.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  523.  
  524.                <input type="radio" name="budgetcost*" value="over50k" />
  525.  
  526.              </div></td>
  527.  
  528.          </tr>
  529.  
  530.          <tr>
  531.  
  532.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
  533.  
  534.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">low</div></td>
  535.  
  536.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">medium</div></td>
  537.  
  538.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">high</div></td>
  539.  
  540.          </tr>
  541.  
  542.          <tr>
  543.  
  544.            <td height="32" bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="left">project
  545.  
  546.                deadline<br />
  547.  
  548.              </div></td>
  549.  
  550.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  551.  
  552.                <input type="radio" name="projectdeadline*" value="low" />
  553.  
  554.              </div></td>
  555.  
  556.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  557.  
  558.                <input type="radio" name="projectdeadline*" value="medium" />
  559.  
  560.              </div></td>
  561.  
  562.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  563.  
  564.                <input type="radio" name="projectdeadline*" value="high" />
  565.  
  566.              </div></td>
  567.  
  568.          </tr>
  569.  
  570.          <tr>
  571.  
  572.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="left"></div></td>
  573.  
  574.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  575.  
  576.                rent</div></td>
  577.  
  578.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  579.  
  580.                sell</div></td>
  581.  
  582.            <td bordercolor="#FFFFFF" bgcolor="#C7E2C0"><div align="center">to
  583.  
  584.                keep</div></td>
  585.  
  586.          </tr>
  587.  
  588.          <tr>
  589.  
  590.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2">why build</td>
  591.  
  592.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  593.  
  594.                <input type="radio" name="whybuild*" value="rent" />
  595.  
  596.              </div></td>
  597.  
  598.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  599.  
  600.                <input type="radio" name="whybuild*" value="sell" />
  601.  
  602.              </div></td>
  603.  
  604.            <td bordercolor="#FFFFFF" bgcolor="#F2FFF2"><div align="center">
  605.  
  606.                <input type="radio" name="whybuild*" value="keep" />
  607.  
  608.              </div></td>
  609.  
  610.          </tr>
  611.  
  612.        </table>
  613.  
  614.        <table width="100%" border="0" cellpadding="4" cellspacing="0" class="textstyle">
  615.  
  616.          <tr bgcolor="#F2FFF2">
  617.  
  618.            <td width="25%">any other notes</td>
  619.  
  620.            <td width="75%" bgcolor="#F2FFF2"><textarea name="otherpreferences" cols="40" class="textstyle" id="otherpreferences"></textarea></td>
  621.  
  622.          </tr>
  623.  
  624.        </table>  <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
  625.  
  626.          <tr bgcolor="#F2FFF2">
  627.  
  628.            <td width="49%"><div align="right">
  629.  
  630.                <input type="submit" name="submit" value="submit" class="textstyle"/>
  631.  
  632.              </div></td>
  633.  
  634.            <td width="2%">&nbsp;</td>
  635.  
  636.            <td width="49%"><input name="reset" type="reset" id="reset" value="reset" class="textstyle" /></td>
  637.  
  638.          </tr>
  639.  
  640.        </table>
  641.  
  642.      </form></td>
  643.  
  644.  </tr>
  645.  
  646. </table>';
  647.  
  648. return $strOut;
  649.  
  650. }
  651.  
  652.  
  653.  
  654. ?>
  655.  
  656. </body>
  657.  
  658. </html>
  659.  
  660.  
  661.  
  662.  
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

another thing i need to put on this form is a reference number so that everytime somone fills out the form then the reference number is incremented by 1.

Post Information

  • Total Posts in this topic: 25 posts
  • Users browsing this forum: No registered users and 90 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.