Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Form problem

  1. #1
    Join Date
    Apr 2009
    Posts
    7

    Question Form problem

    I want to put a form on the site (only for users not for agent) to send an email containing listing details to all of the agents registered on the site.
    I have a form but i don't know how to configure it to send it to all agent's.
    Can somebody help me?
    Sorry my bad english. i hope you would understand me.

  2. #2
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Form problem

    What application are you planning to use to send the emails?

    Also, when you say "users", do you mean Members? OR has Members, Agents and the Admin.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  3. #3
    Join Date
    Apr 2009
    Posts
    7

    Default Re: Form problem

    My form is this:
    <?php
    $email1 = "office@bcimobiliare.ro"; //here i need to colet all agents email adress from the database
    $sme_form_c = "Listing www.bcimobiliare.ro";
    $homepageurl = "http://www.bcimobiliare.ro";
    $response = "www.bcimobiliare.ro Your listing was sent !";
    $tnk = "Your listing was received, we will contact you as soon as possible!";
    $ip = getenv("REMOTE_ADDR");
    $host = gethostbyaddr($ip);
    $browser = $_SERVER["HTTP_USER_AGENT"];
    $date = date("d/m/Y H:i:s"); if (!$_POST['sme_form']) {
    ?>
    <script language="JavaScript" type="text/javascript">
    function checa_formulario(form){
    if (form.nume.value == ""){alert("last name can not be blank!"); form.nume.focus(); return (false);}
    if (form.prenume.value == ""){alert("first name can not be blank!"); form.nume.focus(); return (false);}

    if (form.telefon.value == ""){alert("phone field can not be blank!"); form.telefon.focus(); return (false);}
    else{
    var nr_tel = 1;
    for(i=0;i<form.telefon.value.length;++i)
    if(form.telefon.value.charAt(i) < "0" || form.telefon.value.charAt(i) > "9" || form.telefon.value.charAt(i) == "")
    nr_tel = -1;
    if(nr_tel == -1) {alert("Phone number is not valid.");form.telefon.focus();return (false);}
    }


    if (form.email.value == ""){alert("Email can not be blank!"); form.email.focus();return (false);}
    else {
    var place = form.email.value.indexOf("@",1);
    var point = form.email.value.indexOf(".",place+1);
    if (!((place > -1)&&(form.email.value.length >2)&&(point > 1)))
    {alert("Email is not valid!");form.email.focus();return (false);}
    }

    if (form.tranzactie.value == "alege"){alert("choose transaction type!");form.tranzactie.focus();return (false);}
    if (form.imobil.value == "alege"){alert("choose ap. type!");form.imobil.focus();return (false);}
    if (form.oras.value == ""){alert("city can not be blank!");form.oras.focus();return (false);}
    if (form.zona.value == ""){alert("district/sector can not be blank!");form.zona.focus();return (false);}

    if (form.marime.value == ""){alert("room number/square meters can not be blank!");form.marime.focus();return (false);}
    if (form.pret.value == ""){alert("price can not be blank!");form.pret.focus();return (false);}
    else{
    var nr_tel = 1;
    for(i=0;i<form.pret.value.length;++i)
    if(form.pret.value.charAt(i) < "0" || form.pret.value.charAt(i) > "9" || form.pret.value.charAt(i) == "")
    nr_tel = -1;
    if(nr_tel == -1) {alert("Price is a pozitive number!");form.pret.focus();return (false);}
    }


    return (true);}
    </script>

    <form method="post" action="" name='form' onSubmit='return checa_formulario(this)'>
    <table width="437" border="0" cellspacing="2" cellpadding="0" align="center">
    <tr>
    <td colspan="3" height="30" align="center">LISTING INFO</td>
    </tr>
    <tr><td colspan="3" height="10"></td></tr>
    <tr>

    <td width="133" valign="top"><strong>Personal Info</strong></td>
    <td width="75"></td>
    <td width="221"></td>
    </tr>
    <tr>
    <td width="133"></td>
    <td width="75"></td>
    <td width="221"></td>

    </tr>
    <tr>
    <td width="133">Last Name<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221"><input type="text" name="nume" size="35" maxlength="255" value=""></td>
    </tr>
    <tr>
    <td width="133">First name<font class="style3">*</font></td>

    <td width="75"></td>
    <td width="221"><input type="text" name="prenume" size="35" maxlength="255" value=""></td>
    </tr>
    <tr>
    <td width="133">Phone<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221"><input type="text" name="telefon" size="35" maxlength="15" value=""></td>
    </tr>

    <tr>
    <td width="133">Email<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221"><input type="text" name="email" size="35" maxlength="255" value=""></td>
    </tr>
    <tr><td colspan="3" height="10"></td></tr>
    <tr>
    <td width="133" valign="top"><strong>Listing info</strong></td>

    <td width="75"></td>
    <td width="221"></td>
    </tr>
    <tr>
    <td width="133"></td>
    <td width="75"></td>
    <td width="221"></td>
    </tr>

    <tr>

    <td width="133">Tranzaction type<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221">
    <select name="tranzactie">
    <option selected value="alege">Choose</option>
    <option value="Vand">For sale</option>
    <option value="Ofer pentru inchiriere">For rent</option>
    </select>
    </td>

    </tr>
    <tr>
    <td width="133">Ap. type<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221">
    <select name="imobil">
    <option selected value="alege">Choose</option>
    <option value="Apartament in bloc">Apartament</option>
    <option value="Apartament in vila">Apartament in vila</option>
    <option value="Casa">House</option>
    <option value="Vila">Vila</option>
    <option value="Spatiu birou">Office space</option>
    <option value="Spatiu comercial">Commercial space</option>
    <option value="Teren">Land</option>
    </select>
    </td>
    </tr>

    <tr>
    <td width="133">City<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221"><input type="text" name="oras" size="35" maxlength="255" value="Bucuresti"></td>
    </tr>
    <tr>
    <td width="133">District / Sector<font class="style3">*</font></td>

    <td width="75"></td>
    <td width="221"><input type="text" name="zona" size="35" maxlength="255" value=""></td>
    </tr>
    <tr>
    <td width="133">Rooms number / Square metters<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221"><input type="text" name="marime" size="35" maxlength="255" value=""></td>
    </tr>

    <tr>
    <td width="133">Price (euro)<font class="style3">*</font></td>
    <td width="75"></td>
    <td width="221"><input type="text" name="pret" size="35" maxlength="255" value=""></td>
    </tr>
    <tr>
    <td width="133" valign="top">Negociable price</td>

    <td width="75"></td>
    <td width="221"><input name="negociabil" type="checkbox" value="Negociabil"></td>
    </tr>
    <tr>
    <td width="133" valign="top">Description</td>

    <td width="75"></td>
    <td width="221"><TEXTAREA NAME="descriere" COLS="30" ROWS="5"></TEXTAREA></td>
    </tr>
    <tr>
    <td colspan="3" class="texte">Field marked with <font class="style3">*</font> are required!</td>
    </tr>
    <tr><td colspan="3" height="10"></td></tr>
    <tr>
    <td colspan="3" align="center" class="tm"><input type="hidden" name="sme_form" value="1"><input type="submit" class="style" value="Send listing" name="submit"></td>
    </tr>
    </table>
    </form>

    <?php
    }
    else
    {
    echo "<table width=100%><tr>
    Listing was submitted!
    <br><br>
    Thank you for your listing <b>$_POST[nume]</b>!
    <br>
    You will receive an email from us to: <b>$_POST[email]</b>
    </tr></table></center>";
    mail("$email1", "$sme_form_c","
    Listing sent on: $date
    =====================================
    Last name: $_POST[nume]
    First name: $_POST[prenume]
    Phone: $_POST[telefon]
    Email: $_POST[email]
    Tranzaction type: $_POST[tranzactie]
    Ap. type: $_POST[imobil]
    City: $_POST[oras]
    District/Sector: $_POST[zona]
    Number of rooms / Square meters: $_POST[marime]
    Price: $_POST[pret] $_POST[negociabil]
    Description: $_POST[descriere]
    =====================================
    A few detail about the person who sent the e-mail:
    =====================================
    Ip: $ip
    Host: $host
    Browser: $browser
    =====================================
    \n\n
    ","From: $_POST[email]");

    mail("$_POST[email]", "$response","
    B&C Servicii Imobiliare
    Sos. Stefan cel Mare nr.4,
    Bl14,Et7, Ap.27, sector 1,
    Bucuresti, Romania.
    + 40 21 210 4774
    office@bcimobiliare.ro
    www.bcimobiliare.ro


    $tnk
    =====================================
    Listing sent by you:
    First name: $_POST[nume]
    Last name: $_POST[prenume]
    Phone: $_POST[telefon]
    Email: $_POST[email]
    Transaction type: $_POST[tranzactie]
    Ap type: $_POST[imobil]
    City: $_POST[oras]
    District/ Sector: $_POST[zona]
    Number of rooms / Square metters: $_POST[marime]
    Price: $_POST[pret] $_POST[negociabil]
    Description: $_POST[descriere]
    =====================================
    A few details about the person who sent the e-mail:
    Ip: $ip
    Host: $host
    Browser: $browser
    =====================================
    This email is not a SPAM, it is the answer of
    the email sent by you on:
    www.bcimobiliare.ro. If you didn't sent that message,
    it means that somebody use your email address
    for sending Spams to other person. Message
    was sent from this ip address: $ip. If you
    recognise this person take measurement for
    not being desturbed again.
    ","From: $email1");}
    ?>

    This is not a very complex form, and it's exactly what i need for my listind details

    let me explain better.
    So a member register on the site and maybe he want to send a listing to all agent on the site, so i need something to send his listing details to all the agents.

  4. #4
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Form problem

    Quote Originally Posted by fidodido View Post
    So a member register on the site and maybe he want to send a listing to all agent on the site, so i need something to send his listing details to all the agents.
    Members cannot add listings, only Agents can add listings.

    See: Email Users Listing Notification

    http://wiki.open-realty.org/Configur...ation_settings
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  5. #5
    Join Date
    Apr 2009
    Posts
    7

    Smile Re: Form problem

    I don't want that members post listing on the site, just to send email throw that form to the agents if they have something to rent or to sell.
    I have a site but just for one real estate agency with only one account and i've put such a form for a regular user, who does not have to register, to send listing detailed if he have something to sell.
    But now i want to gather more real estate agency to post their listing and a member will registrate on the site and beside favorites and saveing search i want them to be able to send email to all the agencys with he's listing details.......member will not be able to publish listing on the site just sending emails with listing detalis to all agency . So I need a scrip wich gather all agency's emails in the database to put in this form.

  6. #6
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Form problem

    Quote Originally Posted by fidodido View Post
    So I need a scrip wich gather all agency's emails in the database to put in this form.
    Yes, that's exactly what you need to do.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  7. #7
    Join Date
    Apr 2009
    Posts
    7

    Default Re: Form problem

    I know that is exactly what i need to do, but i want something automated, to search throw the databse and find these addresses.
    I have something like this but it will send emaill to all email address in the database includeing members. I want to exclude members.

    $email1 ='';
    mysql_connect("localhost", "", "") or die (mysql_error());
    mysql_select_db("test") or die (mysql_error());
    $connection=mysql_query ('SELECT * FROM ad_en_userdb ');
    while($row = mysql_fetch_array($connection)) {
    $email1 .=$row['userdb_emailaddress'] .",";
    }
    echo substr($email1, 0, -2);

  8. #8
    Join Date
    Apr 2009
    Posts
    7

    Unhappy Re: Form problem

    Can anybody help me separateing member's emails from agent's email in database? Please

  9. #9
    Join Date
    Apr 2009
    Posts
    7

    Default Re: Form problem

    I manage to solve the problem.
    thsi is the code if anybody else need it:
    $email1 ='';
    mysql_connect("localhost", "user", "pass") or die (mysql_error());
    mysql_select_db("dbname") or die (mysql_error());
    $connection=mysql_query ('SELECT * FROM ad_en_userdb WHERE userdb_is_agent = \'yes\' ');
    while($row = mysql_fetch_array($connection)) {
    $email1 .=$row['userdb_emailaddress'] .",";
    }
    echo substr($email1, 0, -2);

  10. #10
    Join Date
    Apr 2009
    Posts
    1

    Default Re: Form problem

    Sorry. I can not solve the problems you gave out. Hope someone will be able to do it
    Nice day!


    pret auto

Similar Threads

  1. small search form problem
    By georgeuk83 in forum Templates - Help/Ideas/Discussion (CLOSED)
    Replies: 2
    Last Post: 11-05-2008, 08:34 AM
  2. Problem with form submission in addon.inc.php
    By douggreen in forum Addon help, ideas and discussion (CLOSED)
    Replies: 1
    Last Post: 02-18-2008, 05:30 PM
  3. Form border problem
    By virtualgeorge in forum Templates - Help/Ideas/Discussion (CLOSED)
    Replies: 2
    Last Post: 10-15-2006, 03:28 PM
  4. Problem with Add Agent form
    By bgrealty in forum Installation/Configuration Help (CLOSED)
    Replies: 1
    Last Post: 06-25-2006, 11:39 AM
  5. Email form problem
    By roundtable in forum General Help (CLOSED)
    Replies: 0
    Last Post: 05-05-2006, 06:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •