Note Submitter: info at traveletto dot com
----
the mail is only sent to info traveletto.com, not to the
contact_email. What have i done wrong ?
<?php
require_once( GLOBAL_ROOT . 'DB/Database.class.php' );
require_once( SMARTY_CLASS );
require_once( GLOBAL_ROOT . '_smarty.php');
require_once( GLOBAL_ROOT . '_db_start.php');
$object_id = $_GET[ 'object_id' ];
$contact_info = $dbObj->query( 'SELECT object.name AS
object_name, object_type.name AS object_type_name,
contact_firstname, contact_lastname, contact_email,
contact_phone_1, contact_phone_2
FROM object
JOIN object_type ON object.object_type_id =
object_type.object_type_id
WHERE object_id = ' . $object_id . ';' );
$smarty->assign( 'contact_info', $contact_info );
/**
* assign pagerelated info to fill in
<title></title>
*/
$smarty->assign('title', 'Book now - Traveletto.com');
/**
* no mail is sent by default
*/
$smarty->assign( 'mail_sent', false );
/**
* send mail
*/
if( isset( $_GET[ 'send' ] )){
while ($row = mysql_fetch_assoc($contact_info)) {
$tmp_str= $row['object_id'];
}
$strName = $_POST[ 'txtName' ];
$strEmail = $_POST[ 'txtEmail' ];
$strTelephone = $_POST[ 'txtTelephone' ];
$strSubject = 'Traveletto.com - Inquiry regarding object ' .
$contact_info[ 'object_name' ];
// Fix
$strLengtOfStay = $_POST[ 'lenght_of_stay' ];
$strNumberOfGuests = $_POST[ 'number_of_guests' ];
$strYear = $_POST[ 'year' ];
$strMonth = $_POST[ 'month' ];
$strDay = $_POST[ 'day' ];
// end of Fix
$strMessage = $_POST[ 'areaMessage' ];
if($strName == ""){
echo("<b>Must enter a name</b>");
exit;
}
if($strEmail == "") {
$strEmail = "none";
}
if($_POST[ 'areaMessage' ] == ""){
echo("<b>Must enter a message</b>");
exit;
}
$strMessage = "Name: ".$strName."rn";
$strMessage .= "Email:
".$strEmail."rn";
$strMessage .= "Length of stay:
".$strLengtOfStay."rn";
$strMessage .= "Number of Guests:
".$strNumberOfGuests."rn";
$strMessage .= "Date:
".$strDay."-".$strMonth."-".$strYea
r."rnrn";
$strMessage .= $_POST[ 'areaMessage' ];
$strHeaders = "MIME-Version: 1.0rn";
$strHeaders .= "Content-type: text/html;
charset=iso-8859-1rn";
$strHeaders .= "From: " . $strName .
"<". $strEmail . ">rn";
$strHeaders .= "Reply-To:" . $contact_email;
$strHeaders .= "Reply-To: info traveletto.com";
$to_str=$contact_email. ' , info traveletto.com ';
if( mail( $to_str, $strSubject, $strMessage, $strHeaders ) )
{
$smarty->assign( 'mail_sent', true );
}
}
$smarty->display('book_now.tpl');
require_once( GLOBAL_ROOT . '_db_end.php');
?>
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|