Jump to content

Trying to create a form and need help


chris_php

Recommended Posts

I've tried to create a form in HTML and then send an e-mail using PHP - I'm new to PHP and hopefully need just a little help . . . I'm able to submit and send an e-mail to the desired address and display some information to the screen, but I'm unable to get the information that's typed in the form to display in the e-mail or to the screen.

 

Worried about loading the HTML code, it's about 500 lines and the PHP code a little over 200 lines - I know I'm missing something (most likely something simple) but I've been working on this all evening and just can't figure it out . . . not sure what to do next other than load the html file and php file.

 

thanks in advance for any help.

 

Link to comment
Share on other sites

The HTML file:

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>phpTest</title>
<h1>Team</h1>
<hr />
<FONT STYLE="font-size: 14px;" face="Tahoma, Arial, Helvetica">
<TABLE ALIGN="LEFT" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<td id="rightCol">

<form action="phptest.php" method="post">

<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="25%" height="32" align="center" colspan="3">
<font size=2 face="Tahoma, Arial" color=#ff0000>
Red indicates required information to process form.  
</font>
</td>
</tr>
<!------------ HEADER: Buyer Information -------------------------->
<tr><td width="100%" align="left" colspan="3" bgcolor="#464646" height="32"><font size=3 face="Tahoma, Arial" color=#ffffff><b>
  Buyer Information:
</b></font></td></tr>
<!----- Buyer's Name: ------>
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Buyer's Name:  </b></font></td><td width="50%" height="32">
<input name="Buyers_Name" type="text" id="Buyers_Name" size="40"></td></tr>
<!----- Buyer will attend Inspection: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Buyer will attend inspection:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Buyers_Attend" value="Yes"> Yes  
<input type="radio" name="Buyers_Attend" value="No"> No</font></td></tr>
<!----- Daytime Telephone: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Buyer's Daytime Telephone:  </b></font></td><td width="50%" height="32">
<input name="Buyers_Phone" type="text" id="Buyers_Phone" size="18"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Buyers_PhoneType" value="Cell"> C 
<input type="radio" name="Buyers_PhoneType" value="Home"> H 
<input type="radio" name="Buyers_PhoneType" value="Work"> W </font>
</td></tr>
<!----- Alternate Phone: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#000000><b>Buyer's Alternate Phone:  </b></font></td><td width="50%" height="32">
<input name="Buyers_Alternate" type="text" id="Buyers_Alternate" size="18"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Buyers_AltPhoneType" value="Cell"> C 
<input type="radio" name="Buyers_AltPhoneType" value="Home"> H 
<input type="radio" name="Buyers_AltPhoneType" value="Work"> W </font>
</td></tr>
<!----- E-Mail Address: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Buyer's E-Mail Address:  </b></font></td><td width="50%" height="32">
<input name="Buyers_EMail" type="text" id="Buyers_EMail" size="40">
</td></tr></center>
<!------------ HEADER: Inspection Property Information ------------>
<tr><td width="100%" align="left" colspan="3" bgcolor="#464646" height="32"><font size=3 face="Tahoma, Arial" color=#ffffff><b>
  Inspection Property Information:
</b></font></td></tr>
<!----- Property Address: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Inspection Property Address:  </b></font></td><td width="50%" height="32">
<input name="Inspection_Property_Address" type="text" id="Inspection_Property_Address" size="40">
</td></tr>
<!----- Property City: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Inspection Property City:  </b></font></td><td width="50%" height="32">
<input name="Inspection_Property_City" type="text" id="Inspection_Property_City" size="40">
</td></tr>
<!----- Property Square Footage: (Drop Down)----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Inspection Property Square Footage:  </b></font></td>
<td width="50%" height="32" align="left">
<select name="Inspection_Property_SqFt" size="1" id="Inspection_Property_SqFt">
<option value="-- Select --">-- Select --</option>
<option value="Less">Less than 1200 sq ft</option>
<option value="12011500">1201 - 1500 sq ft</option>
<option value="15012000">1501 - 2000 sq ft</option>
<option value="20012500">2001 - 2500 sq ft</option>
<option value="25013000">2501 - 3000 sq ft</option>
<option value="30013500">3001 - 3500 sq ft</option>
<option value="35014000">3501 - 4000 sq ft</option>
<option value="40014500">4001 - 4500 sq ft</option>
<option value="45015000">4501 - 5000 sq ft</option>
<option value="50015500">5001 - 5500 sq ft</option>
<option value="55016000">5501 - 6000 sq ft</option>
<option value="More">More than 6000 sq ft</option>
</select></td>
<!----- Means of Access: (Drop Down) ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Means of Access:  </b></font></td><td width="50%" height="32" align="left">
<select name="Inspection_Property_Access" size="1" id="Inspection_Property_Access">
<option value="-- Select --">-- Select --</option>
<option value="BuyerAgent">Buyer's Agent will open</option>
<option value="Buyer">Buyer will meet with key</option>
<option value="SellerAgent">Seller's Agent will open</option>
<option value="OwnerTenant">Owner/tenant will open</option>
<option value="Door">Door will be open</option>
<option value="Mat">Key under mat</option>
<option value="PickUpBuyer">Pick up key at Buyer's Agents office</option>
<option value="PickUpSeller">Pick up key at Seller's Agents office</option>
</select></td>
<!----- Property in a Gated Community (or) Keybox Code: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Gated Community (or) Keybox Code: </b></font></td><td width="50%" height="32" valign="middle">
<font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Gated" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Gated" value="No"> No 
</font></td></tr>
<!----- Property Gated Community (or) Keybox Code Access Code: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial"><b>Access Code:  </b></font></td><td width="50%" height="32">
<input name="Inspection_Property_Access" type="text" id="Inspection_Property_Access" size="18">
</td></tr>
<!----- Property Occupied: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Occupied:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Occupied" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Occupied" value="No"> No 
</font></td></tr>
<!----- Property Electricity On: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Electricity On:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Electric" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Electric" value="No"> No 
</font></td></tr>
<!----- Property Natural Gas On: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Natural and/or LP Gas On:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Gas" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Gas" value="No"> No 
<input type="radio" name="Inspection_Property_Gas" value="N/A"> N/A 
</font></td></tr>
<!----- Property Water On: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Water On:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Water" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Water" value="No"> No 
</font></td></tr>
<!----- HEADER: Additional Services w/House Inspection: ----->
<tr><td width="100%" align="left" colspan="3" bgcolor="#464646" height="32"><font size=3 face="Tahoma, Arial" color=#ffffff><b>  Additional Services w/House Inspection:  </b></font></td></tr>
<!----- Roof Certification: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Roof Certification:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Additional_Services_Roof_Certification" value="Yes"> Yes 
<input type="radio" name="Additional_Services_Roof_Certification" value="No"> No 
</font></td></tr>
<!----- Lead-Based Paint: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Lead-Based Paint:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Additional_Services_Lead_Paint" value="Yes"> Yes 
<input type="radio" name="Additional_Services_Lead_Paint" value="No"> No 
</font></td></tr>
<!----- Radon: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Radon:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Additional_Services_Radon" value="Yes"> Yes 
<input type="radio" name="Additional_Services_Radon" value="No"> No 
</font></td>
<!----- WDO (Termite): ----->
</tr><tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>WDO (Termite):  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Additional_Services_WDO" value="Yes"> Yes 
<input type="radio" name="Additional_Services_WDO" value="No"> No 
</font></td></tr>
<!----- Property Pool: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Pool:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Pool" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Pool" value="No"> No 
</font></td></tr>
<!----- Property Spa: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Spa:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Inspection_Property_Spa" value="Yes"> Yes 
<input type="radio" name="Inspection_Property_Spa" value="No"> No 
</font></td></tr>
<!----- HEADER: Buyer's Real Estate Agent: ----->
<tr><td width="100%" align="left" colspan="3" bgcolor="#464646" height="32"><font size=3 face="Tahoma, Arial" color=#ffffff><b>  Buyer's Real Estate Agent - Real Estate Co Name</b></font></td></tr>
<!----- Agent Information: ----->
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#000000><b>Submitted by:  </b></font></td>
<td width="50%" height="32" align="left">
<select name="Submitted_By" size="1" id="Submitted_By">
<option value="John">John Doe - (555) 555-1212</option>
<option value="Jane">Jane Doe - (555) 555-1212</option>
<option value="Bob">Bob Q. Public - 555) 555-1212</option>
</select></td>
<!------------ 3 Month Calendar -------------------->
<tr>
<td colspan=3 width="25%" height="32" align="center">
<hr />
<SCRIPT LANGUAGE="JavaScript">

/*
3-month calendar script- Ada Shimar (adashimar@chalktv.com)
Script featured on and available at:
http://www.javascriptkit.com/
*/

//Specify bgcolor of calendar
var bg="#FFFFE1"

//Specify font size
var fs=1

var flg = 0;
//var fs = 1;
M = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
D = new Array(" Sun "," Mon "," Tue "," Wed "," Thu "," Fri "," Sat ");
function getBgn() {
pdy = new Date(); // today
pmo = pdy.getMonth(); // present month
pyr = pdy.getYear(); // present year
if (pyr < 2000) // Y2K Fix, Isaac Powell
pyr = pyr + 1900; // http://onyx.idbsu.edu/~ipowell
yr = yr1 = (pmo==0?pyr-1:pyr); // last month's year
mo = (pmo==0?11:pmo-1); // last month
bgn = new Date(M[mo]+" 1,"+yr1); // assign to date
document.write('<TABLE BORDER=0><TR><TD VALIGN=TOP>');
Calendar(); // Send last month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = pyr; // present year
mo = pmo; // present month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(); // Send this month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = (pmo==11?pyr+1:pyr); // next month's year
mo = (pmo==11?0:pmo+1); // next month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(); // Send next month to screen
document.write('</TD></TR></TABLE>'); // Finish up
}
function Calendar(){
dy = bgn.getDay();
yr = eval(yr);
d = "312831303130313130313031";
if (yr / 4 == Math.floor(yr / 4)) {
d = d.substring(0, 2) + "29" + d.substring(4, d.length);
}
pos = (mo * 2);
ld = eval(d.substring(pos, pos + 2));
document.write("<TABLE BORDER=1"
+ " BGCOLOR='" + bg
+ "'><TR><TD ALIGN=CENTER COLSPAN=7>"
+ "<FONT SIZE=" + fs + ">" + M[mo] + " " + yr
+ "</FONT></TD></TR><TR><TR>");
for (var i = 0;i < 7;i ++) {
document.write("<TD ALIGN=CENTER>"
+"<FONT SIZE="+fs+">" + D[i] + "</FONT></TD>");
}
document.write("</TR><TR>");
ctr = 0;
for (var i = 0;i < 7; i++){
if (i < dy) {
document.write("<TD ALIGN=CENTER>"
+"<FONT SIZE=" + fs + "> </FONT>"
+"</TD>");
}
else {
ctr++;
document.write("<TD ALIGN=CENTER>"
+ "<FONT SIZE=" + fs + ">" + ctr + "</FONT>"
+ "</TD>");
}
}
document.write("</TR><TR>");
while (ctr < ld) {
for (var i = 0;i < 7; i++){
ctr++;
if (ctr > ld){
document.write("<TD ALIGN=CENTER>"
+ " </TD>");
}
else {
document.write("<TD ALIGN=CENTER>"
+ "<FONT SIZE=" + fs + ">" + ctr + "</FONT>"
+ "</TD>");
}
}
document.write("</TR><TR>");
}
document.write("</TR></TABLE>");
}

</SCRIPT>

<P><B>Calendar</B>
<SCRIPT LANGUAGE="JavaScript">

getBgn();

</SCRIPT>
</tr>
<!------------ HEADER: First Inspection Choice -------------------->
<tr>
<td width="100%" align="left" colspan="3" bgcolor="#464646" height="32">
<font size=3 face="Tahoma, Arial" color=#ffffff>
<b>
  First Choice for Inspection Date:
</b>
</font>
</td>
</tr>
<tr>
<td width="25%" height="32" align="right" >
<font size=2 face="Tahoma, Arial" color=#ff0000>
<b>
Month:  
</b>
</font>
</td>
<td width="50%" height="32" align="left">
<select name="firstMonth">
<option>-- Select --</option>
<option value="Janurary">Janurary</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</td>
</tr>
<tr>
<td width="25%" height="32" align="right">
<font size=2 face="Tahoma, Arial" color=#ff0000>
<b>
Day:  
</b>
</font>
</td>
<td width="50%" height="32" align="left">
<select name="firstDay" size="1" id="1stday">
<option>-- Select --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
</td>
</tr>
<tr>
<td width="25%" height="32" align="right">
<font size=2 face="Tahoma, Arial" color=#ff0000>
<b>
Time  
</b>
</font>
</td>
<td width="50%" height="32" align="left">
<select name="firstTime" size="1" id="1sttime">
<option>-- Select --</option>
<option value="AM">AM</option>
<option value="PM">PM</option>
<option value="Anytime">Anytime</option>
</select>
</td>
</tr>
<!------------ HEADER: Second Inspection Choice ----------------->
<tr>
<td width="100%" align="left" colspan="3" bgcolor="#464646" height="32">
<font size=3 face="Tahoma, Arial" color=#ffffff>
<b>
  Second Choice for Inspection Date:
</b>
</font>
</td>
</tr>
<tr>
<td width="25%" height="32" align="right">
<font size=2 face="Tahoma, Arial">
<b>
Month:  
</b>
</font>
</td>
<td width="50%" height="32" align="left">
<select name="secondMonth">
<option>-- Select --</option>
<option value="Janurary">Janurary</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</td>
</tr>
<tr>
<td width="25%" height="32" align="right">
<font size=2 face="Tahoma, Arial">
<b>
Day:  
</b>
</font>
</td>
<td width="50%" height="32" align="left">
<select name="secondDay" size="1" id="2ndday">
<option>-- Select --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
</td>
</tr>
<tr>
<td width="25%" height="32" align="right">
<font size=2 face="Tahoma, Arial">
<b>
Time  
</b>
</font>
</td>
<td width="50%" height="32" align="left">
<select name="secondTime" size="1" id="2ndtime">
<option>-- Select --</option>
<option value="AM">AM</option>
<option value="PM">PM</option>
<option value="Anytime">Anytime</option>
</select>
</td>
<!-- SUBMIT -->
<tr>
<td colspan=2 width="50%" height="32" align="center">
<input type="submit" value="Submit" name="submit">
</td>
<td colspan=2 width="50%" height="32" align="left">
</td>
</tr>
</div>
</table>
<br />
<hr />
</td></table>
<!--- END ----------------- END ----------------- END ----------------- END ----------------->
<!--- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area -------->
</tr>
</table>
</div>
</body>
</html>

 

and now the PHP file:

 

<html>
<head>
<title>Request An Inspection</title>
</head>
<body style="font-family: Courier">
<h3>Team - Request An Inspection</h3>

<?php
//error checking...
/*if ($Buyers_Name
&& $Buyers_Attend
&& $Buyers_Phone
&& $Buyers_PhoneType
&& $Buyers_Alternate
&& $Buyers_AltPhoneType
&& $Buyers_EMail
&& $Inspection_Property_Address
&& $Inspection_Property_City
&& $Inspection_Property_SqFt
&& $Inspection_Property_Access || $Inspection_Property_Access != "-- Select --")
&& $Inspection_Property_Gated
&& $Inspection_Property_Access
&& $Inspection_Property_Occupied
&& $Inspection_Property_Electric
&& $Inspection_Property_Gas
&& $Inspection_Property_Water
&& $Inspection_Property_Pool
&& $Inspection_Property_Spa
// && ($Inspection_Property_Date || $Inspection_Property_Date != "-- Select --")
// && ($Inspection_Property_Time || $Inspection_Property_Time != "-- Select --")
// && ($Inspection_Property_SqFt || $Inspection_Property_SqFt != "-- Select --")
&& $Additional_Services_Roof_Certification
&& $Additional_Services_Lead_Paint
&& $Additional_Services_Radon
&& $Additional_Services_WDO
&& $Submitted_By) */

if(
$Buyers_Name
&& $Buyers_Attend
&& $Buyers_Phone
&& $Buyers_PhoneType
&& $Buyers_Alternate
&& $Buyers_AltPhoneType
&& $Buyers_EMail
&& $Inspection_Property_Address
&& $Inspection_Property_City
&& $Inspection_Property_SqFt || $Inspection_Property_SqFt != "-- Select --"
&& $Submitted_By
&& $Inspection_Property_Access || $Inspection_Property_Access != "-- Select --")
{

//housenspect@gmail.com

if ($Inspection_Property_SqFt == "Less")
{
$caculatedFee = "199";
}
if ($Inspection_Property_SqFt == "12011500")
{
$caculatedFee = "229";
}
if ($Inspection_Property_SqFt == "15012000")
{
$caculatedFee = "259";
}
if ($Inspection_Property_SqFt == "20012500")
{
$caculatedFee = "289";
}
if ($Inspection_Property_SqFt == "25013000")
{
$caculatedFee = "319";
}
if ($Inspection_Property_SqFt == "30013500")
{
$caculatedFee = "349";
}
if ($Inspection_Property_SqFt == "35014000")
{
$caculatedFee = "379";
}
if ($Inspection_Property_SqFt == "40014500")
{
$caculatedFee = "409";
}
if ($Inspection_Property_SqFt == "45015000")
{
$caculatedFee = "439";
}
if ($Inspection_Property_SqFt == "50015500")
{
$caculatedFee = "469";
}
if ($Inspection_Property_SqFt == "55016000")
{
$caculatedFee = "499";
}
if ($Inspection_Property_SqFt == "More")
{
$caculatedFee = "x";
}

if ($caculatedFee == "x")
{
echo"<p>Because of the size of your home, please <a href='hc-inspectors.php'>contact us</a> directly for a quote.</p>";
}
else
{

//echo $caculatedFee . "<br />";

$finalFee = $caculatedFee;
//echo $finalFee . "<br />";

if ($Additional_Services__Roof_Certification == "Yes")
{
$finalFee = $finalFee + 49;
}
if ($Additional_Services__Lead_Based_Paint == "Yes")
{
$finalFee = $finalFee + 49;
}
if ($Additional_Services__Radon == "Yes")
{
$finalFee = $finalFee + 99;
}
if ($Additional_Services__WDO == "Yes")
{
$finalFee = $finalFee + 49;
}
if ($Additional_Services__Pool == "Yes")
{
$finalFee = $finalFee + 79;
}
if ($Additional_Services__Spa == "Yes")
{
$finalFee = $finalFee + 79;
}
if ($Additional_Services__PoolSpa == "Yes")
{
$finalFee = $finalFee + 139;
}
// if ($Additional_Services__Escrow_Billing == "Yes")
// {
// $finalFee = $finalFee + 39;
// }

//echo $finalFee;

//mail the info

mail("housenspect@gmail.com", "Request from HouseNspect.com", "
------------------------------------------------------------------------------------------
T·e·a·m - R·e·q·u·e·s·t N·s·p·e·c·t·i·o·n
------------------------------------------------------------------------------------------

BUYERs INFORMATION:
Name················$Buyers_Name ***
Attend Nspection····$Buyers_Attend
Phone···············$Buyers_Phone ***
PhoneType···········$Buyers_PhoneType
AltPhone············$Buyers_Alternate
PhoneType···········$Buyers_AltPhoneType
Email···············$Buyers_EMail ***

PROPERTY NSPECTION INFORMATION:
Address·············$Inspection_Property_Address ***
City, State······$Inspection_Property_City ***
House Occupied······$Inspection_Property_Occupied
Utilities:
Electricity······$Inspection_Property_Electric
Gas ·············$Inspection_Property_Gas
Water ···········$Inspection_Property_Water

ADDITIONAL SERVICES INFORMATION:
Roof Certification··$Additional_Services_Roof_Certification
Lead Based Paint····$Additional_Services_Lead_Based_Paint
Radon···············$Additional_Services_Radon
WDO·················$Additional_Services_WDO
Pool················$Additional_Services_Pool
Spa·················$Additional_Services_Spa
Escrow Billing......$Additional_Services__Escrow_Billing


Final Fee: $finalFee.00\n",

"From: $Buyers_EMail\nReply-To: $Buyers_EMail\n");
?>
<br />
<h3>===================================================<br />
B·u·y·e·r’s  I·n·f·o·r·m·a·t·i·o·n:<br />
===================================================</h3>
<p>Buyer’s Name:. . . . . . . . . . . . <strong><?php echo $Buyers_Name; ?></strong><br />
Property Inspection Address: . . . . <strong><?php echo $Inspection_Property_Address; ?>, 
<?php echo $Inspection_Property_City; ?></strong><br />
Buyer’s EMail: . . . . . . . . . . . <strong><?php echo $Buyers_EMail; ?></strong><br />
Date Submitted:. . . . . . . . . . . <strong><?php echo date('F j, Y'); ?></strong><br />
Request Submitted By:. . . . . . . . <strong><?php echo $Submitted_By; ?></strong><br />
Fee for the House Nspection: . . . . <strong>$ <?php echo $caculatedFee; ?>.00</strong> <br />
Estimated Total Inspection Fees: . . <strong>$ <?php echo $finalFee; ?>.00</strong></p>
<script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
</script>
<br />
<p><h3><a href="javascript:printWindow()">Print this request for your records.</a></h3></p>


<?php
}
?>

<?php
}
else
{
echo "<p>Please <a href='javascript: history.go(-1)'>go back</a> and fill in all the required fields.</p>";
}
?>

 

Hope this is one of those time you get bored because I need help - thanks in advance!

 

Link to comment
Share on other sites

Tried to go back in and modify and apparently it timed out, sorry, I'm still trying to learn how this board works and I've tried now to downsize the files:

 

the HTML file in smaller version:

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>phpTest</title>

<!--- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --->

<h1>Team</h1>
<hr />

<FONT STYLE="font-size: 14px;" face="Tahoma, Arial, Helvetica">
<TABLE ALIGN="LEFT" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<td id="rightCol">

<!------ Form Data - Begin ------>
<form action="test-short.php" method="post">
<!------ Form Data - End -------->

<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="25%" height="32" align="center" colspan="3">
<font size=2 face="Tahoma, Arial" color=#ff0000>
Red indicates required information to process form.  
</font>
</td>
</tr>

<!------------ HEADER: Buyer Information -------------------------->

<tr><td width="100%" align="left" colspan="3" bgcolor="#464646" height="32"><font size=3 face="Tahoma, Arial" color=#ffffff><b>
  Buyer Information:
</b></font></td></tr>
<!----- Buyer's Name: ------>
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Buyer's Name:  </b></font></td><td width="50%" height="32">
<input name="Buyers_Name" type="text" id="Buyers_Name" size="40"></td></tr>
<!----- Buyer will attend Inspection: ----->
<tr><td width="25%" height="32" align="right" valign="middle"><font size=2 face="Tahoma, Arial"><b>Buyer will attend inspection:  </b></font></td><td width="50%" height="32" valign="middle"><font size=2 face="Tahoma, Arial">
<input type="radio" name="Buyers_Attend" value="Yes"> Yes  
<input type="radio" name="Buyers_Attend" value="No"> No</font></td></tr>


<!-- SUBMIT -->
<tr>
<td colspan=2 width="50%" height="32" align="center">
<input type="submit" value="Submit" name="submit">
</td>
<td colspan=2 width="50%" height="32" align="left">
</td>
</tr>
</div>
</table>

<br />
<hr />


</td></table>

<!--- END ----------------- END ----------------- END ----------------- END ----------------- END ----------------->
<!--- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --->

</tr>
<tr>

</table>
</div>
</body>
</html>

 

The PHP file in a smaller version:

 

<html>
<head>
<title>Request An Inspection</title>
</head>
<body style="font-family: Courier">
<h3>Team - Request An Inspection</h3>

<?php

if(
$Buyers_Name
&& $Buyers_Attend
)
{

//housenspect@gmail.com

//mail the info

mail("housenspect@gmail.com", "Request from HouseNspect.com", "
------------------------------------------------------------------------------------------
T·e·a·m - R·e·q·u·e·s·t N·s·p·e·c·t·i·o·n
------------------------------------------------------------------------------------------

BUYERs INFORMATION:
Name················$Buyers_Name ***
Attend Nspection····$Buyers_Attend


"From: $Buyers_EMail\nReply-To: $Buyers_EMail\n");
?>
<br />
<h3>===================================================<br />
B·u·y·e·r’s  I·n·f·o·r·m·a·t·i·o·n:<br />
===================================================</h3>
<p>Buyer’s Name:. . . . . . . . . . . . <strong><?php echo $Buyers_Name; ?></strong><br />
</p>
<script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
</script>
<br />
<p><h3><a href="javascript:printWindow()">Print this request for your records.</a></h3></p>


<?php
}
?>

<?php
}
else
{
echo "<p>Please <a href='javascript: history.go(-1)'>go back</a> and fill in all the required fields.</p>";
}
?>

 

 

Now I'm not sure if I've cut anything that's important - thanks again!

Link to comment
Share on other sites

@@chris_php please use code tags (


) when posting large amounts of code within posts. Also it helps if you only post just the relevant parts of your code and not whole files. If you want to post whole files then attach them to your post.

Sorry, I'm learning and didn't know how to delete or modify the post before time ran out and the message board would not allow me to make change . . . again, sorry.

Link to comment
Share on other sites

Now have a message that reads:

Team - Request An Inspection

Please go back and fill in all the required fields.

 

did I place the </form> in proper location?

the HTML code - :

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>phpTest</title>

<!--- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --->

<h1>Team</h1>
<hr />

<FONT STYLE="font-size: 14px;" face="Tahoma, Arial, Helvetica">
<TABLE ALIGN="LEFT" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<td id="rightCol">

<!------ Form Data - Begin ------>
<form action="test1.php" method="post">
<!------ Form Data - End -------->

<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="25%" height="32" align="center" colspan="3">
<font size=2 face="Tahoma, Arial" color=#ff0000>
Red indicates required information to process form.  
</font>
</td>
</tr>

<!------------ HEADER: Buyer Information -------------------------->

<tr><td width="100%" align="left" colspan="3" bgcolor="#464646" height="32"><font size=3 face="Tahoma, Arial" color=#ffffff><b>
  Buyer Information:
</b></font></td></tr>
<!----- Buyer's Name: ------>
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Buyer's Name:  </b></font></td><td width="50%" height="32">
<input name="Buyers_Name" type="text" id="Buyers_Name" size="40"></td></tr>

<!----- Buyer's EMail: ------>
<tr><td width="25%" height="32" align="right"><font size=2 face="Tahoma, Arial" color=#ff0000><b>Buyer's EMail:  </b></font></td><td width="50%" height="32">
<input name="Buyers_EMail" type="text" id="Buyers_EMail" size="40"></td></tr>


<!-- SUBMIT -->
<tr>
<td colspan=2 width="50%" height="32" align="center">
<input type="submit" value="Submit" name="submit">
</td>
</form>
<td colspan=2 width="50%" height="32" align="left">
</td>
</tr>
</div>
</table>

<br />
<hr />


</td></table>

<!--- END ----------------- END ----------------- END ----------------- END ----------------- END ----------------->
<!--- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --- Main Display Area --->

</tr>
<tr>

</table>
</div>
</body>
</html>

PHP Code:

<html>
<head>
<title>Request An Inspection</title>
</head>
<body style="font-family: Courier">
<h3>Team - Request An Inspection</h3>

<?php

if(
$Buyers_Name

)
{

//housenspect@gmail.com

//mail the info

mail("housenspect@gmail.com","Request from HouseNspect.com", "
------------------------------------------------------------------------------------------
T&#183;e&#183;a&#183;m - R&#183;e&#183;q&#183;u&#183;e&#183;s&#183;t N&#183;s&#183;p&#183;e&#183;c&#183;t&#183;i&#183;o&#183;n
------------------------------------------------------------------------------------------

BUYERs INFORMATION:
Name&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;&#183;$Buyers_Name ***
Attend Nspection&#183;&#183;&#183;&#183;$Buyers_Attend

Final Fee: $finalFee.00\n",
"From: $Buyers_EMail\nReply-To: $Buyers_EMail\n");
?>
<br />
<h3>===================================================<br />
B·u·y·e·r’s  I·n·f·o·r·m·a·t·i·o·n:<br />
===================================================</h3>
<p>Buyer Name:. . . . . . . . . . . . <strong><?php echo $Buyers_Name;?></strong><br />
</p>
<script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
</script>
<br />
<p><h3><a href="javascript:printWindow()">Print this request for your records.</a></h3></p>


<?php
}
?>

<?php

{
echo "<p>Please <a href='javascript: history.go(-1)'>go back</a> and fill in all the required fields.</p>";
}
?>

Again, thanks . . . I hope I'm posting correctly.

Link to comment
Share on other sites

Ok, loaded up the HTML, and the form seems to work. When submitted, php_test.php receives the following data:

 

//--> POST dump

Array
(
    [buyers_Name] => buyer name
    [buyers_Attend] => Yes
    [buyers_Phone] => 111-222-3333
    [buyers_Alternate] => 222-333-4444
    [buyers_EMail] => buyer@buyer.com
    [inspection_Property_Address] => 1234 Anystreet Ave.
    [inspection_Property_City] => Anycity
    [inspection_Property_SqFt] => 30013500
    [inspection_Property_Access] => 2345
    [inspection_Property_Gated] => Yes
    [inspection_Property_Occupied] => Yes
    [inspection_Property_Electric] => Yes
    [inspection_Property_Gas] => Yes
    [inspection_Property_Water] => Yes
    [Additional_Services_Roof_Certification] => Yes
    [Additional_Services_Lead_Paint] => Yes
    [Additional_Services_Radon] => Yes
    [Additional_Services_WDO] => Yes
    [inspection_Property_Pool] => Yes
    [inspection_Property_Spa] => Yes
    [submitted_By] => Bob
    [firstMonth] => November
    [firstDay] => 26
    [firstTime] => AM
    [secondMonth] => December
    [secondDay] => 10
    [secondTime] => AM
    [submit] => Submit
)



//--> No GET data available.

 

I'll have a look at the php file after breakfast = )

 

PhREEEk

Link to comment
Share on other sites

. . . $_POST['Buyer_Name'] . . .

 

Does that need to be in the PHP file or HTML, sorry, my questions are on the dumb side, but I've been trying to get this to work and I know I'm just overlooking something . . . waiting for PhREEEk to eat breakfast, thanks for your replies and help, really glad I found this board . . . again, everyone thanks!!!!

Link to comment
Share on other sites

Chris - Just wanted to let you know I'm working on this as time permits. Your HTML form seems to be working correctly, and it looks nicely formatted onsceen. The PHP file kind of works, but without extracting the $_POST data directly within the script, this script would only work with register_globals=on in php.ini. It's gonna need some work, and I am working on it, time permitted. If you're patient, I should have something later tonight or tomorrow.

 

To everyone who jumped him for posting the entire code, please understand that I -asked- him to. While some of you only want the 'relevant code', a lot of folks don't know which part of the code is causing the problem, so how can they define what is 'relevant' or not? They can't. I always ask for the entire code. Why? Well, number one, I usually load up the entire code into my server and RUN it. When I provide an entire solution (not just a snippet of help), I want that code to WORK, and work correctly. Secondly, I ask for the entire code sometimes to SAVE TIME.

 

Anyways, welcome to PHP Freaks Chris... sorry for the hassles up front, but you're in a great community now. I'll be around.

 

PhREEEk

Link to comment
Share on other sites

Ok, so here's where we're at... we're going to ditch the second script, and use the form itself to also handle processing duties. I needed to make way for an error-handler, so had to go through and convert your HTML into PHP. In the process, I found quite a few mistakes in the table layout and fixed all of those. I also styled the HTML to a certain extent, which cut out a lot of the inline 'style' tags, as well as ALL of the 'font' tags. I'm no CSS expert, so did the best I could there. I could have stripped it down a lot further, but ran out of dispensable time. The HTML is now properly formatted, too. I did not try to format the Javascript in the middle, not my forte. If you take the source from the browser and hack out the Javascript section, it passes the W3C HTML Validator. Looks perty too = D

 

I think you will find this infinitely easier to work with and/or modify down the road.

 

So, here's the Form in PHP format. Save it as a filename with a .php extension. It right now does nothing but display the form. If you want to play with the form data, you'll need to change the <form> tag "action" property within the build_form() function.

 

After 8 hours or so of re-writing this HTML, I'm seeing triple and need some sleep. I'll start working on the data portion of it when I'm around tomorrow.

 

PhREEEk

 

<?php
send_header();
build_form();
send_footer();

function build_form() {
    echo "<h1>Team</h1>
<hr>
<form name=\"test_form\" action=\"test_form.php\" method=\"post\">
<table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"530\">
  <tr>
    <td>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"530\">
        <tr>
          <td height=\"32\" align=\"center\" colspan=\"2\">
            <span style=\"font-size: 12px; color: #ff0000;\">Red indicates required information to process form.</span>
          </td>
        </tr>
<!-- Buyer Information -->
        <tr>
          <td class=\"cat\" colspan=\"2\">
            <span class=\"cat\">Buyer Information:</span>
          </td>
        </tr>
<!-- Buyer Name: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Buyer's Name:</span>
          </td>
          <td width=\"50%\" height=\"32\">
            <input name=\"Buyers_Name\" type=\"text\" id=\"Buyers_Name\" size=\"40\">
          </td>
        </tr>
<!-- Buyer Inspection: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Buyer will attend inspection:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Buyers_Attend\" value=\"Yes\"> Yes  
              <input type=\"radio\" name=\"Buyers_Attend\" value=\"No\"> No
            </span>
          </td>
        </tr>
<!-- Day Telephone: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Buyer's Daytime Telephone:</span>
          </td>
          <td width=\"50%\" height=\"32\">
            <input name=\"Buyers_Phone\" type=\"text\" id=\"Buyers_Phone\" size=\"18\">
            <span>
              <input type=\"radio\" name=\"Buyers_PhoneType\" value=\"Cell\"> C 
              <input type=\"radio\" name=\"Buyers_PhoneType\" value=\"Home\"> H 
              <input type=\"radio\" name=\"Buyers_PhoneType\" value=\"Work\"> W 
            </span>
          </td>
        </tr>
<!-- Alt Phone: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left\">Buyer's Alternate Phone:</span>
          </td>
          <td width=\"50%\" height=\"32\">
            <input name=\"Buyers_Alternate\" type=\"text\" id=\"Buyers_Alternate\" size=\"18\">
            <span>
              <input type=\"radio\" name=\"Buyers_AltPhoneType\" value=\"Cell\"> C 
              <input type=\"radio\" name=\"Buyers_AltPhoneType\" value=\"Home\"> H 
              <input type=\"radio\" name=\"Buyers_AltPhoneType\" value=\"Work\"> W 
            </span>
          </td>
        </tr>
<!-- E-Mail: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Buyer's E-Mail Address:</span>
          </td>
          <td width=\"50%\" height=\"32\">
            <input name=\"Buyers_EMail\" type=\"text\" id=\"Buyers_EMail\" size=\"40\">
          </td>
        </tr>
<!-- Property Information -->
        <tr>
          <td class=\"cat\" colspan=\"2\">
            <span class=\"cat\">Inspection Property Information:</span>
          </td>
        </tr>
<!-- Property Address: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Inspection Property Address:</span>
          </td>
          <td width=\"50%\" height=\"32\">
            <input name=\"Inspection_Property_Address\" type=\"text\" id=\"Inspection_Property_Address\" size=\"40\">
          </td>
        </tr>
<!-- Property City: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Inspection Property City:</span>
          </td>
          <td width=\"50%\" height=\"32\">
            <input name=\"Inspection_Property_City\" type=\"text\" id=\"Inspection_Property_City\" size=\"40\">
          </td>
        </tr>
<!-- Property Sq. Ft.: (Drop Down) -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Inspection Property Square Footage:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\">
            <select name=\"Inspection_Property_SqFt\" size=\"1\" id=\"Inspection_Property_SqFt\">
                <option value=\"-- Select --\">-- Select --</option>
                <option value=\"Less\">Less than 1200 sq ft</option>
                <option value=\"12011500\">1201 - 1500 sq ft</option>
                <option value=\"15012000\">1501 - 2000 sq ft</option>
                <option value=\"20012500\">2001 - 2500 sq ft</option>
                <option value=\"25013000\">2501 - 3000 sq ft</option>
                <option value=\"30013500\">3001 - 3500 sq ft</option>
                <option value=\"35014000\">3501 - 4000 sq ft</option>
                <option value=\"40014500\">4001 - 4500 sq ft</option>
                <option value=\"45015000\">4501 - 5000 sq ft</option>
                <option value=\"50015500\">5001 - 5500 sq ft</option>
                <option value=\"55016000\">5501 - 6000 sq ft</option>
                <option value=\"More\">More than 6000 sq ft</option>
            </select>
          </td>
        </tr>
<!-- Means of Access: (Drop Down) -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Means of Access:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\">
            <select name=\"Inspection_Property_Access\" size=\"1\" id=\"Inspection_Property_Access\">
                <option value=\"-- Select --\">-- Select --</option>
                <option value=\"BuyerAgent\">Buyer's Agent will open</option>
                <option value=\"Buyer\">Buyer will meet with key</option>
                <option value=\"SellerAgent\">Seller's Agent will open</option>
                <option value=\"OwnerTenant\">Owner/tenant will open</option>
                <option value=\"Door\">Door will be open</option>
                <option value=\"Mat\">Key under mat</option>
                <option value=\"PickUpBuyer\">Pick up key at Buyer's Agents office</option>
                <option value=\"PickUpSeller\">Pick up key at Seller's Agents office</option>
            </select>
          </td>
        </tr>
<!-- Gated Community (or) Keybox Code: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Gated Community (or) Keybox Code:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Gated\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Gated\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Gated Community (or) Keybox Code Access Code: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left\">Access Code:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\">
            <input name=\"Inspection_Property_Access\" type=\"text\" id=\"Inspection_Property_Access_Code\" size=\"18\">
          </td>
        </tr>
<!-- Property Occupied: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Occupied:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Occupied\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Occupied\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Property Electricity On: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Electricity On:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Electric\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Electric\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Property Natural Gas On: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Natural and/or LP Gas On:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Gas\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Gas\" value=\"No\"> No 
              <input type=\"radio\" name=\"Inspection_Property_Gas\" value=\"N/A\"> N/A 
            </span>
          </td>
        </tr>
<!-- Property Water On: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Water On:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Water\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Water\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Additional Services -->
        <tr>
          <td class=\"cat\" colspan=\"2\">
            <span class=\"cat\">Additional Services w/House Inspection:</span>
          </td>
        </tr>
<!-- Roof Certification: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Roof Certification:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Additional_Services_Roof_Certification\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Additional_Services_Roof_Certification\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Lead-Based Paint: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Lead-Based Paint:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Additional_Services_Lead_Paint\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Additional_Services_Lead_Paint\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Radon: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Radon:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Additional_Services_Radon\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Additional_Services_Radon\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- WDO (Termite): -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">WDO (Termite):</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Additional_Services_WDO\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Additional_Services_WDO\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Property Pool: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Pool:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Pool\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Pool\" value=\"No\"> No 
            </span>
          </td>
        </tr>
<!-- Property Spa: -->
        <tr>
          <td height=\"32\" align=\"right\" valign=\"middle\">
            <span class=\"left\">Spa:</span>
          </td>
          <td width=\"50%\" height=\"32\" align=\"left\" valign=\"middle\">
            <span>
              <input type=\"radio\" name=\"Inspection_Property_Spa\" value=\"Yes\"> Yes 
              <input type=\"radio\" name=\"Inspection_Property_Spa\" value=\"No\"> No 
            </span>
          </td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"530\">
<!-- Real Estate Agent: -->
        <tr>
          <td class=\"cat\" colspan=\"2\">
            <span class=\"cat\">Buyer's Real Estate Agent - Real Estate Co Name</span>
          </td>
        </tr>
<!-- Agent Information: -->
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left\">Submitted by:</span>
          </td>
          <td width=\"70%\" height=\"32\" align=\"left\">
            <select name=\"Submitted_By\" size=\"1\" id=\"Submitted_By\">
                <option value=\"John\">John Doe - (555) 555-1212</option>
                <option value=\"Jane\">Jane Doe - (555) 555-1212</option>
                <option value=\"Bob\">Bob Q. Public - 555) 555-1212</option>
            </select>
          </td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"530\">
<!-- 3 Month Calendar -->
        <tr>
          <td colspan=\"2\" height=\"32\" align=\"center\">
            <hr>
";
?>
<SCRIPT LANGUAGE="JavaScript">

/*
3-month calendar script- Ada Shimar (adashimar@chalktv.com)
Script featured on and available at:
http://www.javascriptkit.com/
*/

//Specify bgcolor of calendar
var bg="#FFFFE1"

//Specify font size
var fs=1

var flg = 0;
//var fs = 1;
M = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
D = new Array(" Sun "," Mon "," Tue "," Wed "," Thu "," Fri "," Sat ");
function getBgn() {
pdy = new Date(); // today
pmo = pdy.getMonth(); // present month
pyr = pdy.getYear(); // present year
if (pyr < 2000) // Y2K Fix, Isaac Powell
pyr = pyr + 1900; // http://onyx.idbsu.edu/~ipowell
yr = yr1 = (pmo==0?pyr-1:pyr); // last month's year
mo = (pmo==0?11:pmo-1); // last month
bgn = new Date(M[mo]+" 1,"+yr1); // assign to date
document.write('<TABLE BORDER=0><TR><TD VALIGN=TOP>');
Calendar(); // Send last month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = pyr; // present year
mo = pmo; // present month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(); // Send this month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = (pmo==11?pyr+1:pyr); // next month's year
mo = (pmo==11?0:pmo+1); // next month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(); // Send next month to screen
document.write('</TD></TR></TABLE>'); // Finish up
}
function Calendar(){
dy = bgn.getDay();
yr = eval(yr);
d = "312831303130313130313031";
if (yr / 4 == Math.floor(yr / 4)) {
d = d.substring(0, 2) + "29" + d.substring(4, d.length);
}
pos = (mo * 2);
ld = eval(d.substring(pos, pos + 2));
document.write("<TABLE BORDER=1"
+ " BGCOLOR='" + bg
+ "'><TR><TD ALIGN=CENTER COLSPAN=7>"
+ "<FONT SIZE=" + fs + ">" + M[mo] + " " + yr
+ "</FONT></TD></TR><TR><TR>");
for (var i = 0;i < 7;i ++) {
document.write("<TD ALIGN=CENTER>"
+"<FONT SIZE="+fs+">" + D[i] + "</FONT></TD>");
}
document.write("</TR><TR>");
ctr = 0;
for (var i = 0;i < 7; i++){
if (i < dy) {
document.write("<TD ALIGN=CENTER>"
+"<FONT SIZE=" + fs + "> </FONT>"
+"</TD>");
}
else {
ctr++;
document.write("<TD ALIGN=CENTER>"
+ "<FONT SIZE=" + fs + ">" + ctr + "</FONT>"
+ "</TD>");
}
}
document.write("</TR><TR>");
while (ctr < ld) {
for (var i = 0;i < 7; i++){
ctr++;
if (ctr > ld){
document.write("<TD ALIGN=CENTER>"
+ " </TD>");
}
else {
document.write("<TD ALIGN=CENTER>"
+ "<FONT SIZE=" + fs + ">" + ctr + "</FONT>"
+ "</TD>");
}
}
document.write("</TR><TR>");
}
document.write("</TR></TABLE>");
}

</SCRIPT>

<p>
<b>Calendar</b>
<SCRIPT LANGUAGE="JavaScript">

getBgn();

</SCRIPT>
</p>
<br>
<?php
    echo "          </td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"530\">
<!-- First Choice -->
        <tr>
          <td class=\"cat\" colspan=\"2\">
            <span class=\"cat\">First Choice for Inspection Date:</span>
          </td>
        </tr>
        <tr>
          <td height=\"32\" align=\"right\" >
            <span class=\"left_red\">Month:</span>
          </td>
          <td width=\"85%\" height=\"32\" align=\"left\">
            <select name=\"firstMonth\">
                <option>-- Select --</option>
";
    for ( $x=1 ; $x<13 ; $x++ ) {
        $month = date("F", mktime( 0 , 0 , 0 , $x , 1 ));
        echo "                <option value=\"$month\">$month</option>
";
    }
    echo"            </select>
          </td>
        </tr>
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Day:</span>
          </td>
          <td height=\"32\" align=\"left\">
            <select name=\"firstDay\" size=\"1\" id=\"firstDay\">
                <option>-- Select --</option>
";
    for ( $x=1 ; $x<32 ; $x++ ) {
        echo "                <option value=\"$x\">$x</option>
";
    }
    echo "            </select>
          </td>
        </tr>
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left_red\">Time:</span>
          </td>
          <td height=\"32\" align=\"left\">
            <select name=\"firstTime\" size=\"1\" id=\"firstTime\">
                <option>-- Select --</option>
                <option value=\"AM\">AM</option>
                <option value=\"PM\">PM</option>
                <option value=\"Anytime\">Anytime</option>
            </select>
          </td>
        </tr>
<!-- Second Choice -->
        <tr>
          <td class=\"cat\" colspan=\"3\">
            <span class=\"cat\">Second Choice for Inspection Date:</span>
          </td>
        </tr>
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left\">Month:</span>
          </td>
          <td width=\"85%\" height=\"32\" align=\"left\">
            <select name=\"secondMonth\">
                <option>-- Select --</option>
";
    for ( $x=1 ; $x<13 ; $x++ ) {
        $month = date("F", mktime( 0 , 0 , 0 , $x , 1 ));
        echo "                <option value=\"$month\">$month</option>
";
    }
    echo"            </select>
          </td>
        </tr>
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left\">Day:</span>
          </td>
          <td height=\"32\" align=\"left\">
            <select name=\"secondDay\" size=\"1\" id=\"secondDay\">
                <option>-- Select --</option>
";
    for ( $x=1 ; $x<32 ; $x++ ) {
        echo "                <option value=\"$x\">$x</option>
";
    }
    echo "            </select>
          </td>
        </tr>
        <tr>
          <td height=\"32\" align=\"right\">
            <span class=\"left\">Time:</span>
          </td>
          <td height=\"32\" align=\"left\">
            <select name=\"secondTime\" size=\"1\" id=\"secondTime\">
                <option>-- Select --</option>
                <option value=\"AM\">AM</option>
                <option value=\"PM\">PM</option>
                <option value=\"Anytime\">Anytime</option>
            </select>
          </td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"530\">
<!-- SUBMIT -->
        <tr>
          <td class=\"left\" style=\"padding-left: 20px; padding-top: 30px;\" colspan=\"2\" align=\"left\">
            <span>
              <input type=\"submit\" value=\"Submit\" name=\"submit\">
            </span>
          </td>
        </tr>
      </table>
      <hr>
    </td>
  </tr>
</table>
</form>
";

}

function send_header() {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>phpTest</title>
<style type="text/css">
body {
    background-color: #FFFFFF;
    margin: 0px;
    text-align: left;
    font-family: Tahoma, Arial, Helvetica;
    font-size: 14px
}
span.cat {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: bold;
    padding-left: 8px;
}
span.left {
    color: #000000;
    font-size: 13px;
    font-weight: bold;
    padding-right: 8px;
    padding-left: 8px;
}
span.left_red {
    color: #FF0000;
    font-size: 13px;
    font-weight: bold;
    padding-right: 8px;
    padding-left: 8px;
}
td {
    padding: 0px
}
td.cat {
    height: 32px;
    text-align: left;
    background-color: #464646;
}
</style>
</head>
<?php

}

function send_footer() {
    echo "</body>
</html>";

}
?>

Link to comment
Share on other sites

Sorry, didn't get as much done as I had hoped to today... we had a water pipe explode under the kitchen sink, and I had to get that fixed as well as mop up a fairly good sized flood = /

 

Anyways, error-handler is put together, and I have all the drop-downs, as well as all of the radio selections validating properly. I have the text inputs and the date fields left. I have a few questions...

 

1. Agent drop-down is not in red, so it is not required? Please verify.

 

2. Primary telephone is required, but are the radio selections for C H or W required? Please verify.

 

3. Is this form for US users only? If so, we might want to force a particular telephone input like XXX-XXX-XXXX so people can't forget an area code. Please verify.

 

4. Inspection Date - I will be adding a Year field so we can validate the date. Once submitted, I intend to verify the date is a real calendar day, and is in fact in the future. Do you want to specify a minimum date out (say, 3 days?), and probably more important, a maximum date out (say, 60 days?) ? Do we want to allow for Sat or Sun inspections? Please verify.

 

PhREEEk

Link to comment
Share on other sites

PHP_PhREEEk,

 

What you're doing to help is just unbelievable! I've learned so much from your re-doing the html code already!

To answer your questions posted:

1.) Agent drop-down not is not required, first agent in list would most likely the default.

2.) Radio selection for C H or W would be great, but many times it's just a contact number without knowing if it's C (cell) H (house) or W (work).

3.) For US users only, didn't think about area code being required, so area code is important.

4.) Inspection dates: Monday - Saturday, including any and all holidays that fall within the work week window . . . minimum date out, 1 day with maximum of 30 days . . . most inspections by contract are required to be completed within 14 days . . . would it be difficult to pop-up a note/notice when over 14 days, but still let them choose a date within the next 30 days?

Again, thanks - thanks - thanks!

 

 

Link to comment
Share on other sites

4. Ok, so let's do this, since the window is small enough to pull this off.. Let's have PHP populate the pull-down with all available dates between 1 and 30 days out. These will be actual dates, like: Fri., November 30th, 2007. I think that will serve best, and save a tremendous amount of coding to try and verify all of that after they make a selection. Which also means we should really re-think the Javascript calendar. While convenient, it is also misleading.

 

Not sure I understand the 14 day thing... but I don't really need to right now. Got enough to keep me busy, we'll discuss that in a day or two.

 

PhREEEk

Link to comment
Share on other sites

The java script calendar was just a show the calendar type thing . . . the only one I found that I could use which kept a calendar updated automatically . . . what I meant to say about the 14 days out . . . most inspections are needed and completed within a 14 day window from the first request for an inspection, very few have the opinion to extend beyond the 14 days, so when you asked for a date out, I just picked 30 days as the maximum . . . I'm doing some research to see if it should be set to 14 day maximum.

Thanks again!

Link to comment
Share on other sites

Ok, spent tonight re-creating the calendar system using PHP. That was a trip... hehe but, it works! = )

 

So, the one you were using shows one month prev, the current, and one month forward. Mine shows the current month (I just figured no one would want an inspection date from the past :P ), and if 30 days puts us into a new month, a calendar month forward.

 

Will wait for word on the 14 day thing, but we can integrate a warning if beyond 14 days. The error-handler can provide a variety of messages depending on the actual error. In fact, it can be quite specific, and if an error is thrown, the form is re-displayed with all of the valid data re-populated. So... if the rest of the form is good, but the inspection date is greater than 14 days out, the form can be re-displayed with a warning. If they wish to proceed anyways, they just click submit again and this time it's accepted. If the 14 day thing turns out to be firm, then that's the easiest way to go, of course.

 

Anyways, the calendar coding really kicked my butt there... but I'm really happy with the outcome, and it's accurate.

 

This kind of stuff slows down the final product, but I'm still working as often as I can find time...

 

PhREEEk

Link to comment
Share on other sites

PhREEEk,

. . . Mine shows the current month (I just figured no one would want an inspection date from the past :P ), and if 30 days puts us into a new month, a calendar month forward.

The script was download from a free web source if I remember correctly, someone had directed me to it . . .  your calendar sounds much better . . .

Will wait for word on the 14 day thing, but we can integrate a warning if beyond 14 days. The error-handler can provide a variety of messages depending on the actual error. In fact, it can be quite specific, and if an error is thrown, the form is re-displayed with all of the valid data re-populated. So... if the rest of the form is good, but the inspection date is greater than 14 days out, the form can be re-displayed with a warning. If they wish to proceed anyways, they just click submit again and this time it's accepted.

14 day error works and if they wish to proceed, click again would work as well . . . you have been unbelievable, many thanks again!

Link to comment
Share on other sites

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

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...

Important Information

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