![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
It looks okay to me, but I am not a php pro...yet. For the sake of troubleshooting, you should try doing something like this: ***all your stuff goes here*** $to="webmaster (AT) chinchall (DOT) com"; $to2="admin (AT) chinchall (DOT) com"; mail ($to, $subject, $content); mail ($to2, $subject, $content); Also, you could try this: $to = "webmaster (AT) chinchall (DOT) com" . ", " ; $to .= "admin (AT) chinchall (DOT) com"; Wish I could be more help. cv "awebb" <andywebb25 (AT) hotmail (DOT) com> wrote in message news:beubtt$397$1 (AT) forums (DOT) macromedia.com... I am successfully sending an email containing the results of a form to two addresses BUT... BOTH the addresses are getting TWO emails. One has the field names like "Name: , email etc." but no other content. The other is correctly filled out. They always arrive in that order, i.e. empty, then correct. My hosting company tells me my code is "incorrect" but their "help" ends there. The mail() code is currently in the $editFormAction block and I am wondering if it needs to be further defined by a variable and an if or while statement. The php is: /* emailing info, first set variables*/ $fname=$HTTP_POST_VARS['firstname']; $lname=$HTTP_POST_VARS['lastname']; $startdate1=$HTTP_POST_VARS['startdate1']; $startdate2=$HTTP_POST_VARS['startdate2']; $startdate3=$HTTP_POST_VARS['startdate3']; $startdate4=$HTTP_POST_VARS['startdate4']; $email=$HTTP_POST_VARS['email']; $to="webmaster (AT) chinchall (DOT) com, admin (AT) chinchall (DOT) com"; $subject="Clouseau Booking"; /* The body text */ $content= "Name: ".$fname." ".$lname."\r\n" ."Week1: ".$startdate1."\r\n" ."Week2: ".$startdate2."\r\n" ."Week3: ".$startdate3."\r\n" ."Week4: ".$startdate4."\r\n" ."Email: ".$email."\r\n"; /* send the info */ mail ($to, $subject, $content); Any ideas gratefully received. Andy |
#4
| |||
| |||
|
|
looks ok to me. what is the rest of the code? joe "awebb" <andywebb25 (AT) hotmail (DOT) com> wrote in message news:beubtt$397$1 (AT) forums (DOT) macromedia.com... I am successfully sending an email containing the results of a form to two addresses BUT... BOTH the addresses are getting TWO emails. One has the field names like "Name: , email etc." but no other content. The other is correctly filled out. They always arrive in that order, i.e. empty, then correct. My hosting company tells me my code is "incorrect" but their "help" ends there. The mail() code is currently in the $editFormAction block and I am wondering if it needs to be further defined by a variable and an if or while statement. The php is: /* emailing info, first set variables*/ $fname=$HTTP_POST_VARS['firstname']; $lname=$HTTP_POST_VARS['lastname']; $startdate1=$HTTP_POST_VARS['startdate1']; $startdate2=$HTTP_POST_VARS['startdate2']; $startdate3=$HTTP_POST_VARS['startdate3']; $startdate4=$HTTP_POST_VARS['startdate4']; $email=$HTTP_POST_VARS['email']; $to="webmaster (AT) chinchall (DOT) com, admin (AT) chinchall (DOT) com"; $subject="Clouseau Booking"; /* The body text */ $content= "Name: ".$fname." ".$lname."\r\n" ."Week1: ".$startdate1."\r\n" ."Week2: ".$startdate2."\r\n" ."Week3: ".$startdate3."\r\n" ."Week4: ".$startdate4."\r\n" ."Email: ".$email."\r\n"; /* send the info */ mail ($to, $subject, $content); Any ideas gratefully received. Andy |
#5
| |||
| |||
|
|
looks ok to me. what is the rest of the code? joe "awebb" <andywebb25 (AT) hotmail (DOT) com> wrote in message news:beubtt$397$1 (AT) forums (DOT) macromedia.com... I am successfully sending an email containing the results of a form to two addresses BUT... BOTH the addresses are getting TWO emails. One has the field names like "Name: , email etc." but no other content. The other is correctly filled out. They always arrive in that order, i.e. empty, then correct. My hosting company tells me my code is "incorrect" but their "help" ends there. The mail() code is currently in the $editFormAction block and I am wondering if it needs to be further defined by a variable and an if or while statement. The php is: /* emailing info, first set variables*/ $fname=$HTTP_POST_VARS['firstname']; $lname=$HTTP_POST_VARS['lastname']; $startdate1=$HTTP_POST_VARS['startdate1']; $startdate2=$HTTP_POST_VARS['startdate2']; $startdate3=$HTTP_POST_VARS['startdate3']; $startdate4=$HTTP_POST_VARS['startdate4']; $email=$HTTP_POST_VARS['email']; $to="webmaster (AT) chinchall (DOT) com, admin (AT) chinchall (DOT) com"; $subject="Clouseau Booking"; /* The body text */ $content= "Name: ".$fname." ".$lname."\r\n" ."Week1: ".$startdate1."\r\n" ."Week2: ".$startdate2."\r\n" ."Week3: ".$startdate3."\r\n" ."Week4: ".$startdate4."\r\n" ."Email: ".$email."\r\n"; /* send the info */ mail ($to, $subject, $content); Any ideas gratefully received. Andy |
#6
| |||
| |||
|
|
Yes, you are right, well YOU knew that anyway, but thanks for the help. Its much appreciated. Andy "Joe {RoastHorse}" <joe (AT) roast-horse (DOT) com> wrote in message news:beuiqm$hvj$1 (AT) forums (DOT) macromedia.com... yup - it's the scenario i described previously. you have slotted the mail function in outside this if: if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form")) { ... } the code within the brackets above is executed when the submit button is clicked. your mail function is executed every time the page loads - because it's outside the 'if'. joe "awebb" <andywebb25 (AT) hotmail (DOT) com> wrote in message news:beuh78$ekt$1 (AT) forums (DOT) macromedia.com... Assuming you don't want the whole page, here is the code "above the page": ?php require_once('../Connections/connChin.php'); ? ?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form")) { $insertSQL = sprintf("INSERT INTO clouseau (title, firstname, lastname, address1, address2, towncity, postcode, country, telephone, email, startdate1, startdate2, startdate3, startdate4, totalprice, adults, children, catering, comments) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['title'], "text"), GetSQLValueString($HTTP_POST_VARS['firstname'], "text"), GetSQLValueString($HTTP_POST_VARS['lastname'], "text"), GetSQLValueString($HTTP_POST_VARS['address1'], "text"), GetSQLValueString($HTTP_POST_VARS['address2'], "text"), GetSQLValueString($HTTP_POST_VARS['towncity'], "text"), GetSQLValueString($HTTP_POST_VARS['postcode'], "text"), GetSQLValueString($HTTP_POST_VARS['country'], "text"), GetSQLValueString($HTTP_POST_VARS['telephone'], "text"), GetSQLValueString($HTTP_POST_VARS['email'], "text"), GetSQLValueString($HTTP_POST_VARS['startdate1'], "text"), GetSQLValueString($HTTP_POST_VARS['startdate2'], "text"), GetSQLValueString($HTTP_POST_VARS['startdate3'], "text"), GetSQLValueString($HTTP_POST_VARS['startdate4'], "text"), GetSQLValueString($HTTP_POST_VARS['totalprice'], "int"), GetSQLValueString($HTTP_POST_VARS['adults'], "int"), GetSQLValueString($HTTP_POST_VARS['children'], "int"), GetSQLValueString($HTTP_POST_VARS['catering'], "text"), GetSQLValueString($HTTP_POST_VARS['comments'], "text")); mysql_select_db($database_connChin, $connChin); $Result1 = mysql_query($insertSQL, $connChin) or die(mysql_error()); $insertGoTo = "thanks/thankyou_clouseau.php?email=".$HTTP_POST_VARS['email'].""; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_connChin, $connChin); $query_rsClouseau = "SELECT * FROM clouseau"; $rsClouseau = mysql_query($query_rsClouseau, $connChin) or die(mysql_error()); $row_rsClouseau = mysql_fetch_assoc($rsClouseau); $totalRows_rsClouseau = mysql_num_rows($rsClouseau); /* emailing info, first set variables*/ $fname=$HTTP_POST_VARS['firstname']; $lname=$HTTP_POST_VARS['lastname']; $startdate1=$HTTP_POST_VARS['startdate1']; $startdate2=$HTTP_POST_VARS['startdate2']; $startdate3=$HTTP_POST_VARS['startdate3']; $startdate4=$HTTP_POST_VARS['startdate4']; $email=$HTTP_POST_VARS['email']; $to="webmaster (AT) chinchall (DOT) com, admin (AT) chinchall (DOT) com"; $subject="Clouseau Booking"; /* The body text */ $content= "Name: ".$fname." ".$lname."\r\n" ."Week1: ".$startdate1."\r\n" ."Week2: ".$startdate2."\r\n" ."Week3: ".$startdate3."\r\n" ."Week4: ".$startdate4."\r\n" ."Email: ".$email."\r\n"; /* send the info */ mail ($to, $subject, $content); ? As you can see, this is all created by DMX and I have just slotted in the mail() at the bottom. Andy "Joe {RoastHorse}" <joe (AT) roast-horse (DOT) com> wrote in message news:beuglv$dep$1 (AT) forums (DOT) macromedia.com... looks ok to me. what is the rest of the code? joe "awebb" <andywebb25 (AT) hotmail (DOT) com> wrote in message news:beubtt$397$1 (AT) forums (DOT) macromedia.com... I am successfully sending an email containing the results of a form to two addresses BUT... BOTH the addresses are getting TWO emails. One has the field names like "Name: , email etc." but no other content. The other is correctly filled out. They always arrive in that order, i.e. empty, then correct. My hosting company tells me my code is "incorrect" but their "help" ends there. The mail() code is currently in the $editFormAction block and I am wondering if it needs to be further defined by a variable and an if or while statement. The php is: /* emailing info, first set variables*/ $fname=$HTTP_POST_VARS['firstname']; $lname=$HTTP_POST_VARS['lastname']; $startdate1=$HTTP_POST_VARS['startdate1']; $startdate2=$HTTP_POST_VARS['startdate2']; $startdate3=$HTTP_POST_VARS['startdate3']; $startdate4=$HTTP_POST_VARS['startdate4']; $email=$HTTP_POST_VARS['email']; $to="webmaster (AT) chinchall (DOT) com, admin (AT) chinchall (DOT) com"; $subject="Clouseau Booking"; /* The body text */ $content= "Name: ".$fname." ".$lname."\r\n" ."Week1: ".$startdate1."\r\n" ."Week2: ".$startdate2."\r\n" ."Week3: ".$startdate3."\r\n" ."Week4: ".$startdate4."\r\n" ."Email: ".$email."\r\n"; /* send the info */ mail ($to, $subject, $content); Any ideas gratefully received. Andy |
![]() |
| Thread Tools | |
| Display Modes | |
| |