i have a site whereby you fill in a php form and it sends an auto responder. at another address i can view what has been put in the form because its stored on the internet. i have now made the form alot bigger and now i have run into trouble. here is the code: (the form itself is called getstartedform.php
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function redirect () { setTimeout("go_now()",4000); }
function go_now () { window.location.href = "getstartedform.php"; }
//-->
</SCRIPT>
</head>
<?php
//extract($_REQUEST);
if ($_POST['submit'])
{
$user='';//these fields are filled but i took it out for posting this up
$host='';
$password='';
$database="";
$connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
$db=mysql_select_db($database,$connection);
$sql = "insert into getstarted(name, email, contactAddress, mobile, workHomeTel, contactPostcode, projectPostcode, projectGarden, projectLoft, projectRefit, projectXtension, shopUse, officeUse, homeUse, otherUses, engineer, partywall, projectManager, design, lifestyle, strucural, planning, buildingRegs, otherHelp, wheelchair, partialEyesight, terraced, familyChildren, semiDetached, aged, allergy, detached, other, otherNeeds, needsRefurbishment, needsExtraSpace, needsExtraLight, contemporaryDesignstyle, traditionalDesignstyle, mixedDesignstyle, progTimeComplete1month, progTimeComplete6months, progTimeComplete9months, budgetCost3kto14k, budgetCost15kto45k, budgetCostOver45k, importantThanCostYes, importantThanCostNo, importantThanCostMaybe, importantThanProgYes, importantThanProgNo, importantThanProgMaybe, importantThanDesYes, importantThanDesNo, importantThanDesMaybe, build2rent, build2sell, build2keep, otherBuildingNotes) values ('{$_POST['name']}','{$_POST['email']}','{$_POST['contact_address']}','{$_POST['mobile']}','{$_POST['workhome_tel']}','{$_POST['contact_postcode']}','{$_POST['project_postcode']}','{$_POST['project_garden']}','{$_POST['project_loft']}','{$_POST['project_refit']}','{$_POST['project_extension']}','{$_POST['use_shop']}','{$_POST['use_office']}','{$_POST['use_home']}','{$_POST['use_other']}','{$_POST['engineer']}','{$_POST['partywall']}','{$_POST['projectmanager']}','{$_POST['design']}','{$_POST['lifestyle']}','{$_POST['strucural']}','{$_POST['planning']}','{$_POST['buildingregs']}','{$_POST['otherhelp']}','{$_POST['wheelchair']}','{$_POST['partialeyesight']}','{$_POST['terraced']}','{$_POST['familychildren']}','{$_POST['semidetached']}','{$_POST['aged']}','{$_POST['allergy']}','{$_POST['detached']}','{$_POST['other']}','{$_POST['otherneeds']}','{$_POST['needrefurb']}','{$_POST['need_xspace']}','{$_POST['need_xlight']}','{$_POST['designstyle_contemporary']}','{$_POST['designstyle_traditional']}','{$_POST['designstyle_mixed']}','{$_POST['programtimecompletion_1m']}','{$_POST['programtimecompletion_6m']}','{$_POST['programtimecompletion_9m']}','{$_POST['budgetcost_3kto14k']}','{$_POST['budgetcost_15kto45k']}','{$_POST['budgetcost_over45k']}','{$_POST['importantthancost_yes']}','{$_POST['importantthancost_no']}','{$_POST['importantthancost_maybe']}','{$_POST['importantthanprogram_yes']}','{$_POST['importantthanprogram_no']}','{$_POST['importantthanprogram_maybe']}','{$_POST['importantthandesign_yes']}','{$_POST['importantthandesign_no']}','{$_POST['importantthandesign_maybe']}','{$_POST['whybuild_rent']}','{$_POST['whybuild_sell']}','{$_POST['whybuild_keep']}','{$_POST['otherbuildingnotes']}')";
$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 ><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
{
?>
now here is the php to actually view what has been filled in:
Code:
<?php
$user="";//again i took it out for this posting. all values are the same
$host="";//with regards to the user,host,database,password
$password="";//for both files
$database="";
$connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
$db=mysql_select_db($database,$connection);
$result = mysql_query("select * from getstarted",$connection);
echo "<table border=1 cellpadding=2 cellspacing=2 >";
echo "<tr><td><b>Name</b></td><td><b>email</b></td><td><b>contact address</b></td><td><b>mobile</b></td><td><b>work / home phone number</b></td><td><b>contact postcode</b></td><td><b>project postcode</b></td><td><b>garden project</b></td><td><b>loft project</b></td><td><b>refit project</b></td><td><b>extension project</b></td><td><b>for shop use</b></td><td><b>for office use</b></td><td><b>for home use</b></td><td><b>for another use</b></td><td><b>engineer</b></td><td><b>partywall</b></td><td><b>Project Manager</b></td><td><b>Design</b></td><td><b>Lifestyle</b></td><td><b>Strucural</b></td><td><b>Planning</b></td><td><b>Building Regs</b></td><td><b>Other help</b></td><td><b>Wheelchair Ecology</b></td><td><b>Partial eye sight</b></td><td><b>terraced</b></td><td><b>family and children</b></td><td><b>Semi detached</b></td><td><b>Aged</b></td><td><b>Allergy</b></td><td><b>Detached</b></td><td><b>Other</b></td><td><b>Other needs</b></td><td><b>needs refurbishment</b></td><td><b>Need Extra Space</b></td><td><b>Needs Extra Light</b></td><td><b>Design Style: Contemporary</b></td><td><b>Design style: Traditional</b></td><td><b>Design style: Mixed</b></td><td><b>Program time completion: 1 month</b></td><td><b>Program Time Completion: 6 months</b></td><td><b>Program time completion: 9 months</b></td><td><b>budget cost of 3k-14k</b></td><td><b>budget cost of 15k-45k</b></td><td><b>budget cost of over45k</b></td><td><b>important than cost: yes</b></td><td><b>important than cost: no</b></td><td><b>important than cost: maybe</b></td><td><b>important than program: yes</b></td><td><b>important than program: no</b></td><td><b>important than program: maybe</b></td><td><b>important than design: yes</b></td><td><b>important than design: no</b></td><td><b>important than design: maybe</b></td><td><b>why build: rent</b></td><td><b>why build: sell</b></td><td><b>why build: keep</b></td><td><b>other building notes</b></td></tr>";
while ($myrow = mysql_fetch_array($result))
{
echo "<tr><td>";
echo $myrow["name"];
echo "<td>";
echo $myrow["email"];
echo "<td>";
echo $myrow["contact_address"];
echo "<td>";
echo $myrow["mobile"];
echo "<td>";
echo $myrow["workhome_tel"];
echo "<td>";
echo $myrow["contact_postcode"];
echo "<td>";
echo $myrow["project_postcode"];
echo "<td>";
echo $myrow["project_garden"];
echo "<td>";
echo $myrow["project_loft"];
echo "<td>";
echo $myrow["project_extension"];
echo "<td>";
echo $myrow["use_shop"];
echo "<td>";
echo $myrow["use_office"];
echo "<td>";
echo $myrow["use_home"];
echo "<td>";
echo $myrow["use_other"];
echo "<td>";
echo $myrow["engineer"];
echo "<td>";
echo $myrow["partywall"];
echo "<td>";
echo $myrow["projectmanager"];
echo "<td>";
echo $myrow["design"];
echo "<td>";
echo $myrow["lifestyle"];
echo "<td>";
echo $myrow["structural"];
echo "<td>";
echo $myrow["planning"];
echo "<td>";
echo $myrow["buildingregs"];
echo "<td>";
echo $myrow["otherhelp"];
echo "<td>";
echo $myrow["wheelchair"];
echo "<td>";
echo $myrow["partialeyesight"];
echo "<td>";
echo $myrow["terraced"];
echo "<td>";
echo $myrow["familychildren"];
echo "<td>";
echo $myrow["semidetached"];
echo "<td>";
echo $myrow["aged"];
echo "<td>";
echo $myrow["allergy"];
echo "<td>";
echo $myrow["detached"];
echo "<td>";
echo $myrow["other"];
echo "<td>";
echo $myrow["otherneeds"];
echo "<td>";
echo $myrow["needrefurb"];
echo "<td>";
echo $myrow["need_xspace"];
echo "<td>";
echo $myrow["need_xlight"];
echo "<td>";
echo $myrow["designstyle_contemporary"];
echo "<td>";
echo $myrow["designstyle_traditional"];
echo "<td>";
echo $myrow["designstyle_mixed"];
echo "<td>";
echo $myrow["programtimecompletion_1m"];
echo "<td>";
echo $myrow["programtimecompletion_6m"];
echo "<td>";
echo $myrow["programtimecompletion_9m"];
echo "<td>";
echo $myrow["budgetcost_3kto14k"];
echo "<td>";
echo $myrow["budgetcost_15kto45k"];
echo "<td>";
echo $myrow["budgetcost_over45k"];
echo "<td>";
echo $myrow["importantthancost_yes"];
echo "<td>";
echo $myrow["importantthancost_no"];
echo "<td>";
echo $myrow["importantthancost_maybe"];
echo "<td>";
echo $myrow["importantthanprogram_yes"];
echo "<td>";
echo $myrow["importantthanprogram_no"];
echo "<td>";
echo $myrow["importantthanprogram_maybe"];
echo "<td>";
echo $myrow["importantthandesign_yes"];
echo "<td>";
echo $myrow["importantthandesign_no"];
echo "<td>";
echo $myrow["importantthandesign_maybe"];
echo "<td>";
echo $myrow["whybuild_rent"];
echo "<td>";
echo $myrow["whybuild_sell"];
echo "<td>";
echo $myrow["whybuild_keep"];
echo "<td>";
echo $myrow["otherbuildingnotes"];
}
echo "</table>";
?>
what is not happening is the autoresponder isnt working neither is the viewdb filling up with whatever has be filled out in the getstarted form. can someone have a look at it and help me with this problem please.