Anyone board today?

Discussion in 'PHP' started by NewComputer, Jul 10, 2005.

  1. #1
    PS: Board was a play on words...

    I am looking for a php form mail form to be mailed to me. I have created the form, but cannot get it to $_POST (send me the email of the content). I am trying to get my new real estate site online this week and this is one of the major attractions (DreamHome Finder Form). All I want is the email to be sent to me 'from' the email address that the client puts in. I will handle the data from there. I need a selling form as well, and I need the form to make sense and possibly be editable by me to change drop down functions etc... I am not sure what this is worth to someone who knows php. I have some PR4 pages and I could also pay $ is necessary.

    Thanks if anyone takes this on. Please PM me.
     
    NewComputer, Jul 10, 2005 IP
  2. frankm

    frankm Active Member

    Messages:
    915
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    83
    #2
    not quiet sure if this is what you want:

    
    <?PHP
    mail('you @ email' , 
          'You\'ve got mail', $_POST["message"],
          'From: $_POST[email] ($_POST[name])\r\n' .
          'Reply-To: $_POST[email]\r\n');
    ?>
    
    PHP:
    and ofcourse you need a form with the fields used (email,name and message)
     
    frankm, Jul 10, 2005 IP
  3. NewComputer

    NewComputer Well-Known Member

    Messages:
    2,021
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    188
    #3
    Stephen,

    Here is my code for the form. I attached the PHP as well.

    I would like the required fields to be 'required'. If they are not filled out, I would like a redirect to an error page: error.html.

    The display in email I would like as follows:

    First Name:
    Last Name:
    Phone Number: (req'd)
    Phone Number2:

    Then all other data with comments at the bottom.

    I will post this on the boards as well, to see if anyone jumps on it. I will let you know if someone should.

    Thanks...

    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'POST'){
    $me = $_SERVER['PHP_SELF'];
    ?><form name="form" method="post"
    action="<?php echo $me;?>">

    <table width="413" cellspacing="0" cellpadding="0">
    <tr>
    <td colspan="2"></td>
    </tr>
    <tr>
    <td colspan="2"><b>Would you be interested in information for local:</b></td>

    </tr>
    <tr>
    <td colspan="2"><input type="checkbox" name="schoolsystem" value="schools">Schools <input type="checkbox" name="neighbourhoodinformation" value="neighbourhoods">Neighbourhoods <input type="checkbox" name="localbusiness" value="businesses">Businesses <input type="checkbox" name="parks" value="recreation">Recreation</td>
    </tr>
    <tr>
    <td colspan="2" height="10"></td>
    </tr>

    <tr>
    <td colspan="2">What type of home are you interested in?</td>
    </tr>
    <tr>
    <td colspan="2"><select name="hometype" size="1">
    <option selected value=""></option>
    <option value="Single family home">Single family home</option>
    <option value="Rancher Style">Rancher Style</option>
    <option value="Split Level">Split Level</option>
    <option value="Townhome">Townhome</option>
    <option value="Condo/Apartment">Condo/Apartment</option>
    <option value="Farm/ Acreage">Farm/ Acreage</option>
    <option value="Recreational">Recreational</option>
    <option value="Investment">Investment/Rental Property</option>
    </select></td>
    </tr>
    <tr>
    <td colspan="2">What is your timeframe?</td>
    </tr>

    <tr>
    <td colspan="2"><select name="timeframe" size="1" tabindex="4">
    <option selected value=""></option>
    <option value="Within the next 2 months">Within the next 2 months</option>
    <option value="2 - 6 months">2 - 6 months</option>
    <option value="6 - 12 months">6 - 12 months</option>
    <option value="1 - 2 years">1 - 2 years</option> ing on moving</option>
    <option value="Not moving - second property">Not moving - second property</option>
    </select></td>
    </tr>
    <tr>
    <td colspan="2">Why are you buying at this time?</td>
    </tr>

    <tr>
    <td colspan="2"><select name="reason" size="1" tabindex="5">
    <option selected value=""></option>
    <option value="Job Relocation">Job Relocation</option>
    <option value="Closer to School / Work">Closer to School / Work</option>
    <option value="Upgrading Home / Neighborhood">Upgrading Home / Neighborhood</option>
    <option value="Investment Property">Investment Property</option>
    <option value="Retirement">Retirement</option>
    <option value="Other">Other</option>
    </select></td>
    </tr>
    <tr>
    <td colspan="2">What is your price range?</td>
    </tr>

    <tr>
    <td colspan="2"><select name="pricerange" size="1" tabindex="6">
    <option selected value=""></option>
    <option value="Any Price">Any Price</option>
    <option value="Less than $50,000">Less than $50,000</option>
    <option value="$50,000 - $100,000">$50,000 - $100,000</option>
    <option value="$100,000 - $200,000">$100,000 - $200,000</option>
    <option value="$200,000 - $350,000">$200,000 - $350,000</option>
    <option value="$350,000 - $500,000">$350,000 - $500,000</option>
    <option value="$500,000 - $1,000,000">$500,000 - $1,000,000</option>
    <option value="$1,000,000 - $2,000,000">$1,000,000 - $2,000,000</option>
    <option value="$2,000,000 - $5,000,000">$2,000,000 - $5,000,000</option>
    <option value="$5,000,000 - $10,000,000">$5,000,000 - $10,000,000</option>
    <option value="$10,000,000 +">$10,000,000 +</option>
    </select></td>
    </tr>
    <tr>
    <td colspan="2">Are you currently working with any other Real Estate Agents?</td>
    </tr>
    <tr>
    <td colspan="2"><select name="realtor" size="1" tabindex="7">

    <option selected value=""></option>
    <option value="No, for sale">Not for the sale of my home</option>
    <option value="No, for purchase">Not for the purchase of a home</option>
    <option value="No, for both">Not for my sale or purchase</option>
    <option value="No, first time buyer">No, first time buyer</option>
    <option value="Yes, for sale">Yes, for the sale of my home</option>

    <option value="Yes, for purchase">Yes, for the purchase of a home</option>
    <option value="Yes, for both">Yes, for sale and purchase</option>
    </select></td>
    </tr>
    <tr>
    <td colspan="2">Are your plans to buy a home definite at this time?</td>
    </tr>

    <tr>
    <td colspan="2" align="center"><input type="radio" name="movecertainty" value="Yes" tabindex="8"> Yes&nbsp; <input type="radio" name="movecertainty" value="No"> No, Just Looking</td>
    </tr>
    <tr>
    <td colspan="2" height="10"></td>
    </tr>

    <tr>
    <td colspan="2" align="center" height="25">All fields with <font color="#F97D10">*</font> are required.</td>
    </tr>
    <tr>
    <td align="right">First Name<font color="#F97D10">*</font></td>
    <td><input class="required" type="text" name="FirstName" size="30" tabindex="9"></td>

    </tr>
    <tr>
    <td align="right">Last Name<font color="#F97D10">*</font></td>
    <td><input class="required" type="text" name="LastName" size="30" tabindex="10"></td>
    </tr>
    <tr>
    <td align="right">Phone<font color="#F97D10">*</font></td>

    <td><select name="phone1" size="1" class="required">
    <option selected value="Home">Home</option>
    <option value="Work">Work</option>
    <option value="Cell">Cell</option>
    <option value="Daytime">Daytime Only</option>
    <option value="Evening">Evening Only</option>

    </select> ( <input class="required" onKeyUp="if(this.value.length==3)document.form.set1.focus();" type="text" name="areacode" size="3" maxlength="3" tabindex="11"> ) <input class="required" onKeyUp="if(this.value.length==3)document.form.set2.focus();" type="text" name="set1" size="3" maxlength="3"> - <input class="required" onKeyUp="if(this.value.length==4)document.form.areacode2.focus();" type="text" name="set2" size="4" maxlength="4"></td>
    </tr>
    <tr>
    <td align="right">Phone 2</td>
    <td><select name="phone2" size="1">

    <option value="Home">Home</option>
    <option selected value="Work">Work</option>
    <option value="Cell">Cell</option>
    <option value="Daytime">Daytime Only</option>
    <option value="Evening">Evening Only</option>
    </select> ( <input type="text" name="areacode2" size="3" maxlength="3" tabindex="12"> ) <input type="text" name="set3" size="3" maxlength="3"> - <input onKeyUp="if(this.value.length==4)document.form.emailaddress.focus();" type="text" name="set4" size="4" maxlength="4"></td>

    </tr>
    <tr>
    <td align="right">Email<font color="#F97D10">*</font></td>
    <td><input class="required" type="text" name="emailaddress" size="30" tabindex="13"></td>
    </tr>
    <tr>
    <td align="right" valign="middle">Comments</td>

    <td><textarea name="comments" rows="4" cols="25" tabindex="25"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" height="10"></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" name="submitbutton" value="Submit" tabindex="15"></td>
    </tr>
    <tr>

    <td colspan="2" height="10"></td>
    </tr>
    <tr>
    <td colspan="2"></td>
    </tr>
    </table>

    </form>
    <?php
    } else {
    error_reporting(0);
    }
    ?>
     
    NewComputer, Jul 10, 2005 IP