Page 1 of 1

Form Processing

Posted: Sun Aug 14, 2005 11:10 am
by nickman013
Hi, I have a form on my website, when submitted it is emailed to me, I want to know how to make it email to me and create its own text or html file on my web space with the information that is being sent to me. My current script is

Code: Select all

<?

function generateEmail($realname, $Address, $City, $State, $Zip, $County, $email, $DayPhone, $NightPhone, $smoker, $InsCompanyName, $PolicyExpMonth, $PolicyExpDay, $PolicyExpYear, $AmountInsuredFor, $deductable, $personalumbrella, $liabilitylimit, $area, $SqFootOfHome, $HomeBuiltYear, $hydrants, $HomeType, $Construction, $Roof, $RoofAge, $Foundation, $GarageSize, $GarageType, $BathroomsFull, $BathroomsHalf, $Basement, $BasementSqFt, $DeckSqFt, $PorchSqFt, $ScreenedSqFt, $Chimneys, $Hearths, $HeatingSystem, $CentralAir, $CentralVac, $SecurityAlarm, $FireAlarm, $SmokeDetector, $fireextinguishers, $deadboltlocks, $jewerlry, $jewelryamount, $silverware, $silverwareamount, $furs, $fursamount, $other, $otheramount, $losses, $lossvalue, $mortgage, $escrowed, $buseexp)



{

return "

<html>



<div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>General

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$realname</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Address:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Address</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">City:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$City &nbsp; <b>State:</b> $State

              &nbsp;&nbsp; <b>ZIP:</b> $Zip</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">County:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\"$County &nbsp; <b>Email:</b> $email</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Phone Day:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$DayPhone &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>Night:</b> $NightPhone</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Smoker:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\">$smoker</td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Current

          Homeowners Insurance Company <i>(not agency)</i>:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Company Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$InsCompanyName</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Policy Exp. Date:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$PolicyExpMonth / $PolicyExpDay / $PolicyExpYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Amount Insured For:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $AmountInsuredFor</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Deductable:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $deductable</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Personal Umbrella:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $personalumbrella</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Liability Limit:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $liabilitylimit</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Contents:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\"> $area</font></td>

            </tr>



          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Home

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td></td>

              <td></td>

              <td></td>

              <td></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\"><b>Sq. footage of home</b> (excluding<br>

              garage and basement):</font></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">$SqFootOfHome</font></td>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Year home was built:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SOIZE=\"-1\">$HomeBuiltYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">Fire hydrants on street:</td>

		  <TD ALIGN=\"left\" VALIGN=\"top\" COLSPAN=\"1\" ROWSPAN=\"1\">$hydrant</TD>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Structure

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Type:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Construction:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Roof:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Foundation:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Garage:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\">$HomeType

                  </select></td>

                  <td ALIGN=\"CENTER\">$Construction</td>

                  <td ALIGN=\"CENTER\">$Roof</td>

                  <td ALIGN=\"CENTER\">$Foundation</td>

                  <td ALIGN=\"CENTER\">$GarageSize</td>

                </tr>

                <tr>

                  <td COLSPAN=\"2\">&nbsp;</td>

                  <td ALIGN=\"LEFT\"><font SIZE=\"-1\">Age of roof: &nbsp; $RoofAge yrs.</font></td>

                  <td>&nbsp;</td>

                  <td ALIGN=\"CENTER\">$GarageType</td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Bathrooms:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Basement:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Deck/Porch/Patio:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fireplaces:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp; # of Full: $BathroomsFull &nbsp; <br>

                  &nbsp; # of Half: $BathroomsHalf &nbsp; </font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Basement<br>

                  Sq. Ft: $BasementSqFt</font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">Deck Sq. Ft: $DeckSqFt &nbsp; <br>

                  Porch Sq. Ft: $PorchSqFt &nbsp; <br>

                  &nbsp; Screened Patio Sq. Ft: $ScreenSqFt &nbsp;

                  </font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp;# of Chimneys: $Chimneys &nbsp;<br>

                  &nbsp;# of Hearths: $Hearths &nbsp;</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Heating System:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Air:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Vac:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Security Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fire Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Smoke Detector:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$HeatingSystem</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralAir</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralVac</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SecurityAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$FireAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SmokeDetector</td>

                </tr>

		    <TR>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Fire Extinguishers:</font><BR>

			$fireextinguishers</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Dead Bolt Locks:</font><BR>

			$deadboltlocks</td>

		    </TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

<tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

		    Schedule:

		<TR>

		  <TD>

		    $jewerlry Jewelry &nbsp;&nbsp;&nbsp;$$jewelryamount<BR>

		    $Silverware Silverware &nbsp;&nbsp;&nbsp;$$silverwareamount<BR>

		    $furs Furs &nbsp;&nbsp;&nbsp;$$fursamount<BR>

		    $Other Other &nbsp;&nbsp;&nbsp;$$otheramount<BR>

		  </TD>

		  <TD>

		    Losses in the past 3 years:<BR>

		    $losses &nbsp;&nbsp;&nbsp;Value: $lossvalue

		  </TD>

		</TR>

		<TR>

		  <TD>

		    Mortgage: $mortgage &nbsp;&nbsp;&nbsp;Escrowed:$escrowed

		  </TD>

		  <TD>

		    Is there any business exposure on premesis?<BR>

		    $buseexp

		  </TD>

		</TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Comments:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><font SIZE=\"-1\">Please give any additional comments about the coverage

                  you desire:<br>

                  $comments</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div>

";



}



// ..........



mail("nickman013@mac.com",

"Regional Planning Home Quote Submission Form",generateEmail($realname, $Address, $City, $State, $Zip, $County, $email, $DayPhone, $NightPhone, $smoker, $InsCompanyName, $PolicyExpMonth, $PolicyExpDay, $PolicyExpYear, $AmountInsuredFor, $deductable, $personalumbrella, $liabilitylimit, $area, $SqFootOfHome, $HomeBuiltYear, $hydrants, $HomeType, $Construction, $Roof, $RoofAge, $Foundation, $GarageSize, $GarageType, $BathroomsFull, $BathroomsHalf, $Basement, $BasementSqFt, $DeckSqFt, $PorchSqFt, $ScreenedSqFt, $Chimneys, $Hearths, $HeatingSystem, $CentralAir, $CentralVac, $SecurityAlarm, $FireAlarm, $SmokeDetector, $fireextinguishers, $deadboltlocks, $jewerlry, $jewelryamount, $silverware, $silverwareamount, $furs, $fursamount, $other, $otheramount, $losses, $lossvalue, $mortgage, $escrowed, $buseexp),  

"Content-type: text/html\r\n"); 

?>

Posted: Sun Aug 14, 2005 11:30 am
by John Cartwright
fopen(), fwrite(), fclose(). Other functions you may want to look at chmod() to give PHP permission for writting files.

Be sure to read the user comments on the following pages, as they provide many examples.

Posted: Sun Aug 14, 2005 11:44 am
by nickman013
Thank you for the quick response.
I am going to read the documentation you sent me.

Thanks Again

Posted: Sun Aug 14, 2005 1:13 pm
by nickman013
Ok, I think I did it right, but it doesnt work.

Here is the script that the form is processed on, it contains the email script and the script that stores the form on the web.

(dont laugh i probly made something that will never work or a mistake that is stupid, but i am a noobie)

Code: Select all

<?

function generateEmail($realname, $Address, $City, $State, $Zip, $County, $email, $DayPhone, $NightPhone, $smoker, $InsCompanyName, $PolicyExpMonth, $PolicyExpDay, $PolicyExpYear, $AmountInsuredFor, $deductable, $personalumbrella, $liabilitylimit, $area, $SqFootOfHome, $HomeBuiltYear, $hydrant, $HomeType, $Construction, $Roof, $RoofAge, $Foundation, $GarageSize, $GarageType, $BathroomsFull, $BathroomsHalf, $Basement, $BasementSqFt, $DeckSqFt, $PorchSqFt, $ScreenedPatioSqFt, $Chimneys, $Hearths, $HeatingSystem, $CentralAir, $CentralVac, $SecurityAlarm, $FireAlarm, $SmokeDetector, $fireextinguishers, $deadboltlocks, $jewerlry, $jewelryamount, $silverware, $silverwareamount, $furs, $fursamount, $other, $otheramount, $losses, $lossvalue, $mortgage, $escrowed, $busexp, $comments)



{

return "

<html>



<div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>General

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$realname</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Address:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Address</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">City:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$City &nbsp; <b>State:</b> $State

              &nbsp;&nbsp; <b>ZIP:</b> $Zip</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">County:</font></b> $County </td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\" &nbsp; <b>Email:</b> $email</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Phone Day:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$DayPhone &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>Night:</b> $NightPhone</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Smoker:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\">$smoker</td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Current

          Homeowners Insurance Company <i>(not agency)</i>:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Company Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$InsCompanyName</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Policy Exp. Date:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$PolicyExpMonth / $PolicyExpDay / $PolicyExpYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Amount Insured For:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $AmountInsuredFor</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Deductable:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $deductable</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Personal Umbrella:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $personalumbrella</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Liability Limit:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $liabilitylimit</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Contents:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\"> $area</font></td>

            </tr>



          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Home

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td></td>

              <td></td>

              <td></td>

              <td></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\"><b>Sq. footage of home</b> (excluding<br>

              garage and basement):</font></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">$SqFootOfHome</font></td>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Year home was built:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SOIZE=\"-1\">$HomeBuiltYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">Fire hydrants on street:</td>

		  <TD ALIGN=\"left\" VALIGN=\"top\" COLSPAN=\"1\" ROWSPAN=\"1\"> $hydrant</TD>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Structure

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Type:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Construction:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Roof:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Foundation:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Garage:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\">$HomeType

                  </select></td>

                  <td ALIGN=\"CENTER\">$Construction</td>

                  <td ALIGN=\"CENTER\">$Roof</td>

                  <td ALIGN=\"CENTER\">$Foundation</td>

                  <td ALIGN=\"CENTER\">$GarageSize</td>

                </tr>

                <tr>

                  <td COLSPAN=\"2\">&nbsp;</td>

                  <td ALIGN=\"LEFT\"><font SIZE=\"-1\">Age of roof: &nbsp; $RoofAge yrs.</font></td>

                  <td>&nbsp;</td>

                  <td ALIGN=\"CENTER\">$GarageType</td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Bathrooms:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Basement:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Deck/Porch/Patio:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fireplaces:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp; # of Full: $BathroomsFull &nbsp; <br>

                  &nbsp; # of Half: $BathroomsHalf &nbsp; </font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Basement<br>

                  Sq. Ft: $BasementSqFt</font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">Deck Sq. Ft: $DeckSqFt &nbsp; <br>

                  Porch Sq. Ft: $PorchSqFt &nbsp; <br>

                  &nbsp; Screened Patio Sq. Ft: $ScreenedPatioSqFt &nbsp;

                  </font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp;# of Chimneys: $Chimneys &nbsp;<br>

                  &nbsp;# of Hearths: $Hearths &nbsp;</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Heating System:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Air:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Vac:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Security Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fire Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Smoke Detector:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$HeatingSystem</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralAir</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralVac</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SecurityAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$FireAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SmokeDetector</td>

                </tr>

		    <TR>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Fire Extinguishers:</font><BR>

			$fireextinguishers</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Dead Bolt Locks:</font><BR>

			$deadboltlocks</td>

		    </TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

<tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

		    Schedule:

		<TR>

		  <TD>

		    $jewerlry Jewelry &nbsp;&nbsp;&nbsp;$$jewelryamount<BR>

		    $Silverware Silverware &nbsp;&nbsp;&nbsp;$$silverwareamount<BR>

		    $furs Furs &nbsp;&nbsp;&nbsp;$$fursamount<BR>

		    $Other Other &nbsp;&nbsp;&nbsp;$$otheramount<BR>

		  </TD>

		  <TD>

		    Losses in the past 3 years:<BR>

		    $losses &nbsp;&nbsp;&nbsp;Value: $lossvalue

		  </TD>

		</TR>

		<TR>

		  <TD>

		    Mortgage: $mortgage &nbsp;&nbsp;&nbsp;Escrowed:$escrowed

		  </TD>

		  <TD>

		    Is there any business exposure on premesis?<BR>

		    $busexp

		  </TD>

		</TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Comments:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><font SIZE=\"-1\">


                  $comments</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div>

";



}



// ..........



mail("nickman013@mac.com",

"Regional Planning Home Quote Submission Form",generateEmail($realname, $Address, $City, $State, $Zip, $County, $email, $DayPhone, $NightPhone, $smoker, $InsCompanyName, $PolicyExpMonth, $PolicyExpDay, $PolicyExpYear, $AmountInsuredFor, $deductable, $personalumbrella, $liabilitylimit, $area, $SqFootOfHome, $HomeBuiltYear, $hydrant, $HomeType, $Construction, $Roof, $RoofAge, $Foundation, $GarageSize, $GarageType, $BathroomsFull, $BathroomsHalf, $Basement, $BasementSqFt, $DeckSqFt, $PorchSqFt, $ScreenedPatioSqFt, $Chimneys, $Hearths, $HeatingSystem, $CentralAir, $CentralVac, $SecurityAlarm, $FireAlarm, $SmokeDetector, $fireextinguishers, $deadboltlocks, $jewerlry, $jewelryamount, $silverware, $silverwareamount, $furs, $fursamount, $other, $otheramount, $losses, $lossvalue, $mortgage, $escrowed, $busexp, $comments),  

"Content-type: text/html\r\n"); 


chmod("test.rtf", 666);
$handle = fopen("test.rtf, "wb");
$filename = 'test.rtf';
$somecontent = "<html>



<div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>General

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$realname</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Address:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Address</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">City:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$City &nbsp; <b>State:</b> $State

              &nbsp;&nbsp; <b>ZIP:</b> $Zip</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">County:</font></b> $County </td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\" &nbsp; <b>Email:</b> $email</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Phone Day:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$DayPhone &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>Night:</b> $NightPhone</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Smoker:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\">$smoker</td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Current

          Homeowners Insurance Company <i>(not agency)</i>:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Company Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$InsCompanyName</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Policy Exp. Date:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$PolicyExpMonth / $PolicyExpDay / $PolicyExpYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Amount Insured For:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $AmountInsuredFor</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Deductable:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $deductable</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Personal Umbrella:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $personalumbrella</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Liability Limit:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $liabilitylimit</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Contents:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\"> $area</font></td>

            </tr>



          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Home

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td></td>

              <td></td>

              <td></td>

              <td></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\"><b>Sq. footage of home</b> (excluding<br>

              garage and basement):</font></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">$SqFootOfHome</font></td>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Year home was built:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SOIZE=\"-1\">$HomeBuiltYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">Fire hydrants on street:</td>

		  <TD ALIGN=\"left\" VALIGN=\"top\" COLSPAN=\"1\" ROWSPAN=\"1\"> $hydrant</TD>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Structure

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Type:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Construction:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Roof:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Foundation:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Garage:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\">$HomeType

                  </select></td>

                  <td ALIGN=\"CENTER\">$Construction</td>

                  <td ALIGN=\"CENTER\">$Roof</td>

                  <td ALIGN=\"CENTER\">$Foundation</td>

                  <td ALIGN=\"CENTER\">$GarageSize</td>

                </tr>

                <tr>

                  <td COLSPAN=\"2\">&nbsp;</td>

                  <td ALIGN=\"LEFT\"><font SIZE=\"-1\">Age of roof: &nbsp; $RoofAge yrs.</font></td>

                  <td>&nbsp;</td>

                  <td ALIGN=\"CENTER\">$GarageType</td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Bathrooms:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Basement:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Deck/Porch/Patio:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fireplaces:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp; # of Full: $BathroomsFull &nbsp; <br>

                  &nbsp; # of Half: $BathroomsHalf &nbsp; </font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Basement<br>

                  Sq. Ft: $BasementSqFt</font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">Deck Sq. Ft: $DeckSqFt &nbsp; <br>

                  Porch Sq. Ft: $PorchSqFt &nbsp; <br>

                  &nbsp; Screened Patio Sq. Ft: $ScreenedPatioSqFt &nbsp;

                  </font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp;# of Chimneys: $Chimneys &nbsp;<br>

                  &nbsp;# of Hearths: $Hearths &nbsp;</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Heating System:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Air:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Vac:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Security Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fire Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Smoke Detector:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$HeatingSystem</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralAir</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralVac</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SecurityAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$FireAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SmokeDetector</td>

                </tr>

		    <TR>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Fire Extinguishers:</font><BR>

			$fireextinguishers</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Dead Bolt Locks:</font><BR>

			$deadboltlocks</td>

		    </TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

<tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

		    Schedule:

		<TR>

		  <TD>

		    $jewerlry Jewelry &nbsp;&nbsp;&nbsp;$$jewelryamount<BR>

		    $Silverware Silverware &nbsp;&nbsp;&nbsp;$$silverwareamount<BR>

		    $furs Furs &nbsp;&nbsp;&nbsp;$$fursamount<BR>

		    $Other Other &nbsp;&nbsp;&nbsp;$$otheramount<BR>

		  </TD>

		  <TD>

		    Losses in the past 3 years:<BR>

		    $losses &nbsp;&nbsp;&nbsp;Value: $lossvalue

		  </TD>

		</TR>

		<TR>

		  <TD>

		    Mortgage: $mortgage &nbsp;&nbsp;&nbsp;Escrowed:$escrowed

		  </TD>

		  <TD>

		    Is there any business exposure on premesis?<BR>

		    $busexp

		  </TD>

		</TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Comments:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><font SIZE=\"-1\">


                  $comments</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div>\n";

// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {

ÊÊ // In our example we're opening $filename in append mode.
ÊÊ // The file pointer is at the bottom of the file hence 
ÊÊ // that's where $somecontent will go when we fwrite() it.
ÊÊ if (!$handle = fopen($filename, 'a')) {
ÊÊ Ê Ê Ê echo "Cannot open file ($filename)";
ÊÊ Ê Ê Ê exit;
ÊÊ }

ÊÊ // Write $somecontent to our opened file.
ÊÊ if (fwrite($handle, $somecontent) === FALSE) {
ÊÊ Ê Ê echo "Cannot write to file ($filename)";
ÊÊ Ê Ê exit;
ÊÊ }
ÊÊ 
ÊÊ echo "Success, wrote ($somecontent) to file ($filename)";
ÊÊ 
ÊÊ fclose($handle);

} else {
ÊÊ echo "The file $filename is not writable";
}



?>
and this is the error people get when the form is submitted

Code: Select all

Warning: chmod failed: No such file or directory in /web/u54/www22882/www/other/home22.php3 on line 589

Parse error: parse error in /web/u54/www22882/www/other/home22.php3 on line 590
The form does get submitted through mail though. I just get those errors.

Any help would be great. Also I am a noobie at this stuff so please provide me with stuff I would understand. Thank You in Advanced.

Posted: Sun Aug 14, 2005 1:23 pm
by John Cartwright
change

Code: Select all

$handle = fopen("test.rtf, "wb");
to

Code: Select all

$handle = fopen("test.rtf", "wb");

Posted: Sun Aug 14, 2005 1:32 pm
by nickman013
thank you for the quick response.

i did what you said and it got passed it, now it shows up with

Code: Select all

Fatal error: Call to unsupported or undefined function is_writable() in /web/u54/www22882/www/other/home22.php3 on line 1152
line 1152 is:

Code: Select all

if (is_writable($filename)) {
i do not know what is wrong. thank you again

Posted: Sun Aug 14, 2005 1:57 pm
by John Cartwright
Your obviously using php3 correct?
All I can suggest is verify the file exists (file_exists()) and check if the wriitting to the file was sucesfful or not.
Other than that I suggest you upgrade immediatly as php3 is ancient.

Posted: Sun Aug 14, 2005 2:52 pm
by nickman013
i am going to have to. but i deleted all the ÊÊ from the script and it got passed the parse errors
and now it says
Cannot open file (test.rtf)
i made the permissions 777 and it still didnt work...

i dont know the problem.. my script is below:

Code: Select all

<?

function generateEmail($realname, $Address, $City, $State, $Zip, $County, $email, $DayPhone, $NightPhone, $smoker, $InsCompanyName, $PolicyExpMonth, $PolicyExpDay, $PolicyExpYear, $AmountInsuredFor, $deductable, $personalumbrella, $liabilitylimit, $area, $SqFootOfHome, $HomeBuiltYear, $hydrant, $HomeType, $Construction, $Roof, $RoofAge, $Foundation, $GarageSize, $GarageType, $BathroomsFull, $BathroomsHalf, $Basement, $BasementSqFt, $DeckSqFt, $PorchSqFt, $ScreenedPatioSqFt, $Chimneys, $Hearths, $HeatingSystem, $CentralAir, $CentralVac, $SecurityAlarm, $FireAlarm, $SmokeDetector, $fireextinguishers, $deadboltlocks, $jewerlry, $jewelryamount, $silverware, $silverwareamount, $furs, $fursamount, $other, $otheramount, $losses, $lossvalue, $mortgage, $escrowed, $busexp, $comments)



{

return "

<html>



<div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>General

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$realname</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Address:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Address</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">City:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$City &nbsp; <b>State:</b> $State

              &nbsp;&nbsp; <b>ZIP:</b> $Zip</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">County:</font></b> $County </td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\" &nbsp; <b>Email:</b> $email</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Phone Day:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$DayPhone &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>Night:</b> $NightPhone</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Smoker:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\">$smoker</td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Current

          Homeowners Insurance Company <i>(not agency)</i>:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Company Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$InsCompanyName</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Policy Exp. Date:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$PolicyExpMonth / $PolicyExpDay / $PolicyExpYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Amount Insured For:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $AmountInsuredFor</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Deductable:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $deductable</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Personal Umbrella:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $personalumbrella</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Liability Limit:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $liabilitylimit</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Contents:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\"> $area</font></td>

            </tr>



          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Home

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td></td>

              <td></td>

              <td></td>

              <td></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\"><b>Sq. footage of home</b> (excluding<br>

              garage and basement):</font></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">$SqFootOfHome</font></td>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Year home was built:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SOIZE=\"-1\">$HomeBuiltYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">Fire hydrants on street:</td>

		  <TD ALIGN=\"left\" VALIGN=\"top\" COLSPAN=\"1\" ROWSPAN=\"1\"> $hydrant</TD>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Structure

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Type:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Construction:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Roof:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Foundation:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Garage:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\">$HomeType

                  </select></td>

                  <td ALIGN=\"CENTER\">$Construction</td>

                  <td ALIGN=\"CENTER\">$Roof</td>

                  <td ALIGN=\"CENTER\">$Foundation</td>

                  <td ALIGN=\"CENTER\">$GarageSize</td>

                </tr>

                <tr>

                  <td COLSPAN=\"2\">&nbsp;</td>

                  <td ALIGN=\"LEFT\"><font SIZE=\"-1\">Age of roof: &nbsp; $RoofAge yrs.</font></td>

                  <td>&nbsp;</td>

                  <td ALIGN=\"CENTER\">$GarageType</td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Bathrooms:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Basement:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Deck/Porch/Patio:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fireplaces:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp; # of Full: $BathroomsFull &nbsp; <br>

                  &nbsp; # of Half: $BathroomsHalf &nbsp; </font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Basement<br>

                  Sq. Ft: $BasementSqFt</font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">Deck Sq. Ft: $DeckSqFt &nbsp; <br>

                  Porch Sq. Ft: $PorchSqFt &nbsp; <br>

                  &nbsp; Screened Patio Sq. Ft: $ScreenedPatioSqFt &nbsp;

                  </font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp;# of Chimneys: $Chimneys &nbsp;<br>

                  &nbsp;# of Hearths: $Hearths &nbsp;</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Heating System:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Air:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Vac:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Security Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fire Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Smoke Detector:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$HeatingSystem</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralAir</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralVac</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SecurityAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$FireAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SmokeDetector</td>

                </tr>

		    <TR>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Fire Extinguishers:</font><BR>

			$fireextinguishers</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Dead Bolt Locks:</font><BR>

			$deadboltlocks</td>

		    </TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

<tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

		    Schedule:

		<TR>

		  <TD>

		    $jewerlry Jewelry &nbsp;&nbsp;&nbsp;$$jewelryamount<BR>

		    $Silverware Silverware &nbsp;&nbsp;&nbsp;$$silverwareamount<BR>

		    $furs Furs &nbsp;&nbsp;&nbsp;$$fursamount<BR>

		    $Other Other &nbsp;&nbsp;&nbsp;$$otheramount<BR>

		  </TD>

		  <TD>

		    Losses in the past 3 years:<BR>

		    $losses &nbsp;&nbsp;&nbsp;Value: $lossvalue

		  </TD>

		</TR>

		<TR>

		  <TD>

		    Mortgage: $mortgage &nbsp;&nbsp;&nbsp;Escrowed:$escrowed

		  </TD>

		  <TD>

		    Is there any business exposure on premesis?<BR>

		    $busexp

		  </TD>

		</TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Comments:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><font SIZE=\"-1\">


                  $comments</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div>

";



}



// ..........



mail("nickman013@mac.com",

"Regional Planning Home Quote Submission Form",generateEmail($realname, $Address, $City, $State, $Zip, $County, $email, $DayPhone, $NightPhone, $smoker, $InsCompanyName, $PolicyExpMonth, $PolicyExpDay, $PolicyExpYear, $AmountInsuredFor, $deductable, $personalumbrella, $liabilitylimit, $area, $SqFootOfHome, $HomeBuiltYear, $hydrant, $HomeType, $Construction, $Roof, $RoofAge, $Foundation, $GarageSize, $GarageType, $BathroomsFull, $BathroomsHalf, $Basement, $BasementSqFt, $DeckSqFt, $PorchSqFt, $ScreenedPatioSqFt, $Chimneys, $Hearths, $HeatingSystem, $CentralAir, $CentralVac, $SecurityAlarm, $FireAlarm, $SmokeDetector, $fireextinguishers, $deadboltlocks, $jewerlry, $jewelryamount, $silverware, $silverwareamount, $furs, $fursamount, $other, $otheramount, $losses, $lossvalue, $mortgage, $escrowed, $busexp, $comments),  

"Content-type: text/html\r\n"); 


chmod("test.rtf", 666);
$handle = fopen("test.rtf", "wb");
$filename = 'test.rtf';
$somecontent = "<html>



<div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>General

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$realname</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Address:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Address</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">City:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$City &nbsp; <b>State:</b> $State

              &nbsp;&nbsp; <b>ZIP:</b> $Zip</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">County:</font></b> $County </td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\" &nbsp; <b>Email:</b> $email</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Phone Day:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$DayPhone &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>Night:</b> $NightPhone</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Smoker:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\">$smoker</td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Current

          Homeowners Insurance Company <i>(not agency)</i>:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Company Name:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$InsCompanyName</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Policy Exp. Date:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$PolicyExpMonth / $PolicyExpDay / $PolicyExpYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Amount Insured For:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $AmountInsuredFor</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Deductable:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $deductable</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Personal Umbrella:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $personalumbrella</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Liability Limit:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\">$ $liabilitylimit</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Contents:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"TOP\"><font SIZE=\"-1\"> $area</font></td>

            </tr>



          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Home

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td></td>

              <td></td>

              <td></td>

              <td></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\"><b>Sq. footage of home</b> (excluding<br>

              garage and basement):</font></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">$SqFootOfHome</font></td>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><b><font SIZE=\"-1\">Year home was built:</font></b></td>

              <td ALIGN=\"LEFT\" VALIGN=\"BOTTOM\"><font SOIZE=\"-1\">$HomeBuiltYear</font></td>

            </tr>

            <tr>

              <td ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"><font SIZE=\"-1\">Fire hydrants on street:</td>

		  <TD ALIGN=\"left\" VALIGN=\"top\" COLSPAN=\"1\" ROWSPAN=\"1\"> $hydrant</TD>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Structure

          Information</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Type:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Construction:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Roof:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Foundation:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Garage:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\">$HomeType

                  </select></td>

                  <td ALIGN=\"CENTER\">$Construction</td>

                  <td ALIGN=\"CENTER\">$Roof</td>

                  <td ALIGN=\"CENTER\">$Foundation</td>

                  <td ALIGN=\"CENTER\">$GarageSize</td>

                </tr>

                <tr>

                  <td COLSPAN=\"2\">&nbsp;</td>

                  <td ALIGN=\"LEFT\"><font SIZE=\"-1\">Age of roof: &nbsp; $RoofAge yrs.</font></td>

                  <td>&nbsp;</td>

                  <td ALIGN=\"CENTER\">$GarageType</td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Bathrooms:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Basement:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Deck/Porch/Patio:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fireplaces:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp; # of Full: $BathroomsFull &nbsp; <br>

                  &nbsp; # of Half: $BathroomsHalf &nbsp; </font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$Basement<br>

                  Sq. Ft: $BasementSqFt</font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">Deck Sq. Ft: $DeckSqFt &nbsp; <br>

                  Porch Sq. Ft: $PorchSqFt &nbsp; <br>

                  &nbsp; Screened Patio Sq. Ft: $ScreenedPatioSqFt &nbsp;

                  </font></td>

                  <td ALIGN=\"RIGHT\" VALIGN=\"TOP\"><font SIZE=\"-1\">&nbsp;# of Chimneys: $Chimneys &nbsp;<br>

                  &nbsp;# of Hearths: $Hearths &nbsp;</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Heating System:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Air:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Central Vac:</font></b></td>

                  <td ALIGN=\"CENTER\"><b><font SIZE=\"-1\">Security Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Fire Alarm:</font></b></td>

                  <td ALIGN=\"CENTER\" \"><b><font SIZE=\"-1\">Smoke Detector:</font></b></td>

                </tr>

                <tr>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$HeatingSystem</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralAir</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$CentralVac</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SecurityAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$FireAlarm</font></td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">$SmokeDetector</td>

                </tr>

		    <TR>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Fire Extinguishers:</font><BR>

			$fireextinguishers</td>

                  <td ALIGN=\"CENTER\" VALIGN=\"TOP\"><font SIZE=\"-1\">Dead Bolt Locks:</font><BR>

			$deadboltlocks</td>

		    </TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

<tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Features</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

		    Schedule:

		<TR>

		  <TD>

		    $jewerlry Jewelry &nbsp;&nbsp;&nbsp;$$jewelryamount<BR>

		    $Silverware Silverware &nbsp;&nbsp;&nbsp;$$silverwareamount<BR>

		    $furs Furs &nbsp;&nbsp;&nbsp;$$fursamount<BR>

		    $Other Other &nbsp;&nbsp;&nbsp;$$otheramount<BR>

		  </TD>

		  <TD>

		    Losses in the past 3 years:<BR>

		    $losses &nbsp;&nbsp;&nbsp;Value: $lossvalue

		  </TD>

		</TR>

		<TR>

		  <TD>

		    Mortgage: $mortgage &nbsp;&nbsp;&nbsp;Escrowed:$escrowed

		  </TD>

		  <TD>

		    Is there any business exposure on premesis?<BR>

		    $busexp

		  </TD>

		</TR>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div><div align=\"center\"><center><table WIDTH=\"600\" BORDER=\"2\">

        <tr>

          <td ALIGN=\"CENTER\" VALIGN=\"TOP\" BGCOLOR=\"#aaaaaa\"><font COLOR=\"#000000\"><b>Additional

          Comments:</b></font></td>

        </tr>

        <tr>

          <td ALIGN=\"CENTER\"><table WIDTH=\"590\" BGCOLOR=\"#dddddd\" CELLPADDING=\"2\" CELLSPACING=\"0\"

          BORDER=\"0\">

            <tr>

              <td ALIGN=\"CENTER\"><table BORDER=\"2\" CELLSPACING=\"0\">

                <tr>

                  <td ALIGN=\"CENTER\"><font SIZE=\"-1\">


                  $comments</font></td>

                </tr>

              </table>

              </td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

      </center></div>\n";

echo "Cannot open file ($filename)";
exit;
}


if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);

} else {
echo "The file $filename is not writable";
}



?>

Posted: Sun Aug 14, 2005 3:01 pm
by John Cartwright
because the file does not exist in the same directory where the file is.. either point fopen/chmod to the proper directory or place your file in the file directory as your php script... :?

Posted: Sun Aug 14, 2005 3:07 pm
by nickman013
it is correct. it still wont access it.

below is the error.
Cannot open file (test.htm)

Posted: Mon Aug 15, 2005 1:02 pm
by nickman013
if anyo ne knows please help,, i dont want this topic to die...

Posted: Mon Aug 15, 2005 1:46 pm
by feyd
is_writable can be written using the stat() function. The following is untested, but was cross-referenced with php.net for php3 compatibility

Code: Select all

if(!function_exists('is_writable'))
{
  function is_writable($filename)
  {
    $stat = stat($filename);
    $mode = (isset($stat['mode']) ? $stat['mode'] : $stat[2]);
    $uid = (isset($stat['uid']) ? $stat['uid'] : $stat[4]);
    $gid = (isset($stat['gid']) ? $stat['gid'] : $stat[5]);
    $mask = 2;
    if(function_exists('getmygid'))
    {
      $mask |= ($gid == getmygid() ? 16 : 0);
    }
    if(function_exists('getmyuid'))
    {
      $mask |= ($uid == getmyuid() ? 128 : 0);
    }
    return ($mask & $mode ? true : false);
  }
}

the code above requires php 3.0.7 or higher (function_exists())

Posted: Mon Aug 15, 2005 9:11 pm
by nickman013
thanks for responding.

i dont know if i am going to do this because it is so hard to do (for me)

but after i upgrade to a new server i will try it again.