Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
A lil' help please. [form script]
Old 07-23-2008, 02:59 AM A lil' help please. [form script]
Junior Talker

Posts: 1
Name: Nadeen
Trades: 0
Hi guys, my boyfriend's having a lot of trouble with a form script. The script (mail) should be sending two emails, one "Thank you" mail for the client, and one "Information" mail for himself. The problem is that it's sending four emails, two "Thank you" mails for the client, except one is empty, and two "Information" mails for himself, and again, one of them is empty. Here's the part of the script which I think contains the problem:

PHP Code:
$query_prop "SELECT pname from property where id_prop='$id_prop'";
$res_prop $system->Execute($query_prop) or die ($system->ErrorMsg());
$propname $res_prop->Fields('pname');
$para "email1@host.com";
$asunto "Reservation in process";
$nombre "Some Realtors";
$decorreo "email2@host.com";
$mensaje "<p>Thanks</p><p>Dear " $fname " " $lname "</p><p>Thank you for your inquiry regarding " $propname "</p><p>Your information has been received and a Some Realtor Representative will contact the property owner to confirm availability and rates. You can normally expect to receive a response within 24 hours from one of our agent to complete the reservation.</p><p>If you have any questions you can also contact us by phone at one of these numbers:</p><p>US number: 1 (415) 691-4351<br>Mexico Office: (322) 221-0286 & 87</p>";
$headers "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Some Realtors <email2@host.com>\r\n"
$para2 "email1@host.com";
$asunto2 "Reservation Request";
$nombre2 $fname " " $lname;
$decorreo2 $email;
$headers2 "MIME-Version: 1.0\r\n";
$headers2 .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers2 .= "From: " $nombre2 " <" $decorreo2 ">\r\n"
$mensaje2 "A new reservation request has been placed, please verify the information and confirm to the client. The guest information is: <br> Name: " $fname " " $lname " <br> Other names: " $anames " <br> Mailing adress: " $madress ", " $madress2 " <br> City: " $city " <br> Zip Code: " $zcode " <br> Country: " $country " <br> Phone: " $phone " <br> Email: " $email " <br> Property name: " $propname " <br> Arrival: " $arrival " <br> Depart: " $depart " <br> Nights: " $nights " <br> Adults: " $adults " <br> Child(ren): " $child "<br> Arrival Airline: " $airl1 "<br> Flight: " $flight1 "<br> Time: " $time1"<br> Departure Airline: " $airl2 "<br> Flight: " $flight2 "<br> Time: " $time2 "<br> VIP: " $vips "<br> Comments: " $comments;
if (
$enviado == "No") {
mail($para2$asunto2$mensaje2$headers2);
mail($para$asunto$mensaje$headers);
$enviado "ok";

Any help would be tremendously appreciated.
Nadeen is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-23-2008, 03:16 AM Re: A lil' help please. [form script]
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
That code doesn't send 4 messages. You're comparing "$enviado" which I believe means "send" but that's your first mention of it, which leads me to think that there's more code to this than meets the eye. You'll need to post that for greater assistance.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-24-2008, 10:50 AM Re: A lil' help please. [form script]
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
Quote:
if ($enviado == "No") {
mail($para2, $asunto2, $mensaje2, $headers2);
mail($para, $asunto, $mensaje, $headers);
$enviado = "ok";
}
This part send two mails on the same address because $para and $para2 have the same values.
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 07-27-2008, 11:34 PM Re: A lil' help please. [form script]
Junior Talker

Posts: 3
Trades: 0
why not create a loop of mailing?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
IGiveMoney is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to A lil' help please. [form script]
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.77540 seconds with 12 queries