Jump to content

My script is not writing to file or email


avl8386

Recommended Posts

For some reason my script is putting nothing but | marks in the data file and no info in the email.  Anyone see problems?

 

 

this is process.php

<?php
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="
Customer Move Estimate Request From Hawkeyemover.com
First Name- ".$firstname."
Last Name- ".$lastname."
Home phone- ".$homephone."
Cell Phone- ".$cellphone."
Email Add- ".$email."
Best way to contact- ".$bestcontact."
Move Being paid for by- ".$movepay."
Customer moving from- ".$origcity."
Lives in a- ".$movefrom."
There are (".$origfloors.") floors (including basment)
Customer lives on the (".$origmulti.") floor (if multi level building)
Elevator- ".$origelev." 
Packing services- ".$origpack."
Destination Info
Customer Moving to- ".$destcity."
Moving into a- ".$moveto."
There are (".$destfloors.") floors (including basment)
Customer lives on the (".$destmulti.") floor (if multi level building)
Dest Elevator- ".$destelev."
Unpacking- ".$destpack."
Estimated Move Date-".$movedate."
Additional Comments-   ".$addinfo."
Were referrd to us by-".$refer." 
";

$message = stripslashes($message);
mail("[email protected]","      Online Estimate Request From HawkeyeMover.com",$message,"From: HawkeyeMover.com");
$make=fopen("estimatedata.txt","a");
$to_put="";
$to_put .= $firstname."|".$lastname."|".$homephone."|".$cellphone."|".$email."|".$bestcontact."|".$movepay."|".$origcity."|".$movefrom."|".$origfloors."|".$origmulti."|".$origelev."|".$origpack."|".$destcity."|".$moveto."|".$destfloors."|".$destmulti."|".$destelev."|".$destpack."|".$movedate."|".$addinfo."
";

fwrite($make,$to_put);
?>

 

this is the html file

<Form name="estimate"  action="processestimate.php" method="post">
<table width="479" height="814" border="0" align="center">
  <tr>
    <td colspan="3"><strong>Customer Information</strong></td>
  </tr>
  <tr>
    <td width="94" align="right" valign="top" class="style4"> </td>
    <td width="184" align="right" valign="top"><span class="style4">First Name:</span></td>
    <td width="179" align="left" valign="top"><span class="style3">
      <input name="firstname" type="text" id="firstname" />
    </span></td>
  </tr>
  <tr>
    <td height="23" align="right" valign="top" class="style4"><p class="style3"> </p>    </td>
    <td align="right" valign="top"><span class="style3">Last Name:</span></td>
    <td align="left" valign="top"><span class="style3">
      <input name="lastname" type="text" id="lastname" />
    </span></td>
  </tr>
  <tr>
    <td height="30" align="right" valign="top" class="style4"> </td>
    <td align="right" valign="top"><span class="style4"><span class="style3">Home Phone:</span></span></td>
    <td align="left" valign="top"><input name="homephone" type="text" id="homephone"></td>
  </tr>
  <tr>
    <td align="right" valign="top" class="style4"> </td>
    <td align="right" valign="top"><span class="style4"><span class="style3">Cell Phone:</span></span></td>
    <td align="left" valign="top"><span class="style3">
      <input name="cellphone" type="text" id="cellphone" />
    </span></td>
  </tr>
  <tr>
    <td align="right" valign="top" class="style4"> </td>
    <td align="right" valign="top"><span class="style4"><span class="style3">Email:</span></span></td>
    <td align="left" valign="top"><span class="style3">
      <input name="email" type="text" id="email" />
    </span></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top" class="style4">The Best Way To Contact Me Is:</td>
    <td align="left" valign="top"><span class="style3">
      <select name="bestcontact" size="1" id="bestcontact">
        <option value="none" selected="selected">Please Select</option>
        <option value="Home Phone">Home Phone</option>
        <option value="Cell Phone">Cell Phone</option>
        <option value="Email">Email</option>
      </select>
    </span></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top"> </td>
    <td align="left" valign="top"> </td>
  </tr>
  <tr>
    <td colspan="3" align="left" valign="top"><strong>Origin Information</strong></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top" class="style4">Origin City And State:</td>
    <td align="left" valign="top"><span class="style3">
      <input name="origcity" type="text" id="origcity" />
    </span></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top" class="style4">I Am Moving From A:</td>
    <td align="left" valign="top"><span class="style3">
      <select name="movefrom" size="1" id="movefrom">
        <option value="none" selected="selected">Please Select</option>
        <option value="House">House</option>
        <option value="Condo">Condo</option>
        <option value="Apartment">Apartment</option>
        <option value="Storage Unit">Storage Unit</option>
        <option value="Office">Office</option>
      </select>
    </span></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top" class="style4"># of floors (including basement):</td>
    <td align="left" valign="top"><input name="origfloors" type="text" id="origfloors" /></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top" class="style4">If Apartment/Condo what floor(s) are you on?:</td>
    <td align="left" valign="top"><input name="origmulti" type="text" id="origmulti" /></td>
  </tr>
  <tr>
    <td colspan="2" align="right" valign="top" class="style4">Is There An Elevator?:</td>
    <td align="left" valign="top"><select name="origelev" size="1" id="origelev">
      <option value="No" selected>No</option>
      <option value="Yes">Yes</option>
    </select></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">Do You Need Packing Services?:</td>
    <td align="left" valign="top"><select name="origpack" size="1" id="origpack">
      <option value="No" selected="selected">No</option>
      <option value="Yes">Yes</option>
    </select></td>
  </tr>
  <tr>
    <td height="25" colspan="3" align="left" valign="top"><strong>Destination Info</strong></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">Destination City And State:</td>
    <td align="left" valign="top"><span class="style3">
      <input name="destcity" type="text" id="destcity" />
    </span></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">I Am Moving Into A:</td>
    <td align="left" valign="top"><span class="style3">
      <select name="moveto" size="1" id="moveto">
        <option value="none" selected="selected">Please Select</option>
        <option value="House">House</option>
        <option value="Condo">Condo</option>
        <option value="Apartment">Apartment</option>
        <option value="Storage Unit">Storage Unit</option>
        <option value="Office">Office</option>
      </select>
    </span></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4"># of floors (including basement):</td>
    <td align="left" valign="top"><input name="destfloors" type="text" id="destfloors" /></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">If Apartment/Condo what floor(s) are you on?:</td>
    <td align="left" valign="top"><input name="destmulti" type="text" id="destmulti" /></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">Is There An Elevator?:</td>
    <td align="left" valign="top"><select name="destelev" size="1" id="destelev">
      <option value="No" selected="selected">No</option>
      <option value="Yes">Yes</option>
    </select></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">Do You Need Unpacking Services?:</td>
    <td align="left" valign="top"><select name="destpack" size="1" id="destpack">
      <option value="No" selected="selected">No</option>
      <option value="Yes">Yes</option>
    </select></td>
  </tr>
  <tr class="style4">
    <td height="25" colspan="3" align="left" valign="top"><strong>Additional Information</strong></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">Approximate Move Date</td>
    <td align="left" valign="top"><input name="movedate" type="text" id="movedate" /></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">My Move Is Being Paid For By:</td>
    <td align="left" valign="top"><span class="style3">
      <select name="movepay" size="1" id="movepay">
        <option value="none" selected="selected">Please Select</option>
        <option value="Myself">Myself</option>
        <option value="Mycompany">My Company</option>
        <option value="Other">Other</option>
      </select>
    </span></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4"><p>Additional Info</p>
    <p>(concerns, special care items, questions, comments):</p></td>
    <td align="left" valign="top"><textarea cols="20" rows="8" name="addinfo" wrap="virtual" type="text"  id="addinfo"></textarea></td>
  </tr>
    <tr>
    <td height="25" colspan="2" align="right" valign="top" class="style4">How were you referred to our site?:</td>
    <td align="left" valign="top"><span class="style3">
      <select name="refer" size="1" id="refer">
        <option value="none" selected="selected">Please Select</option>
        <option value="Search Engine">Search Engine</option>
        <option value="Previous Move">Previous Move</option>
        <option value="Friend">Friend</option>
        <option value="Other">Other</option>
      </select>
    </span></td>
  </tr>
  <tr>
    <td colspan="3" align="center" valign="top"><input type="submit" name="Submit" value="Submit"></td>
  </tr>
</table>
</Form>

Is your $message having the proper variables? just looking for debug options... making sure that the variables are indeed being set is all. echo $message for the hell of it just to see if variables are ever being set. If no message and nothing but | in data file I'd say the variables are all empty and never set.

Archived

This topic is now archived and is closed to further replies.

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