Contact

 *

“;
}
else $aD[$f] = “

 

“;
}
else {
$okFields=0;
$aD[$f] = “

*

“;
$$f=””;
unset ($_POST[‘save_order’]);
}
}
if (!isset($_POST[‘save_order’])) $_POST[‘save_order’]=0;
?>
1 AND $okFields==0) echo “

$fill
“;
if ($okFields==1) {
echo “
$sent

“;
echo $aTerms[‘my_name’].”: $my_name
“;
echo $aTerms[‘phone’].”: $phone
“;
echo $aTerms[’email’].”: $email
“;
echo $aTerms[‘message’].”
“;
echo nl2br(stripslashes($message));
echo “
“;
$_POST[‘save_order’]=0;
$dbhost = ‘localhost’;
$database_name = ‘ipmonito_advert’;
$dbusername = ‘ipmonito_advert’;
$dbpasswd = ‘advert’;
$connection = mysql_connect(“$dbhost”,”$dbusername”,”$dbpasswd”) or die (‘Error DB:’.mysql_error());
$db = mysql_select_db(“$database_name”, $connection) or die(“Connection error: “.mysql_error());
$source = $_SERVER[‘HTTP_HOST’].$link;
$sourcePage = str_replace(“http://”,””,$source);
$sourcePage = str_replace(“www.”,””,$sourcePage);
$n=strlen($sourcePage);
if (substr($sourcePage,$n-1,1)==”/”) $sourcePage = substr($sourcePage,0,$n-1);
$landingPage=$sourcePage;
$nPos = strpos($landingPage,”idJob=”);
if ($nPos>0) $landingPage=substr($landingPage,0,$nPos-1);
$landingPage=str_replace(“&lang=en”,””,$landingPage);
$landingPage=str_replace(“&lang=ro”,””,$landingPage);
$landingPage=str_replace(“&lang=ru”,””,$landingPage);
$landingPage=str_replace(“?lang=en”,””,$landingPage);
$landingPage=str_replace(“?lang=ro”,””,$landingPage);
$landingPage=str_replace(“?lang=ru”,””,$landingPage);
$reqSQL = “SELECT * FROM pages WHERE page LIKE (‘%$landingPage%’)”;
$result = mysql_query($reqSQL);
if (mysql_num_rows($result)>0){
$row = mysql_fetch_object($result);
$id_page = $row->id;
$mail_to = $row->mail_to;
}
else $id_page=0;
if (isset($_SESSION[‘idJob’])) $idJob=$_SESSION[‘idJob’];
if (isset($_GET[‘idJob’])) $idJob=$_GET[‘idJob’];
if (!isset($idJob)) $idJob=0;
$ip = $_SERVER[‘REMOTE_ADDR’]; $date=gmDate(“Y-m-d H:i:s”);
$reqSQL = “INSERT INTO orders (`id_job`,`id_page`,`source`,`name`,`phone`,`email`,`message`,`ip`,`lang`,`date`) VALUES(‘$idJob’,’$id_page’,’$sourcePage’,’$my_name’,’$phone’,’$email’,’$message’,’$ip’,’$order_lang’,’$date’)”;
mysql_query($reqSQL);
$date = gmDate(“d-m-Y H:i:s”, time() + $zone);
$sBody = “Date: $date
\n”;
$sBody .= “Order from: $sourcePage
\n”;
$sBody .= “Name: “.stripslashes($my_name).”
\n”;
$sBody .= “Phone: “.stripslashes($phone).”
\n”;
$sBody .= “Email: “.stripslashes($email).”
\n”;
$sBody .= “Message: “.nl2br(stripslashes($message)).”
\n”;
if (!isset($mail_to)) $mail_to=$defaultMail;
$headers = ‘MIME-Version: 1.0’ . “\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\n”;
$txtSubject=”Contact”;
$to = $mail_to;
if (strstr($to,”;”)==””) $errMessValue1=mail($to, “Order from $sourcePage”, $sBody, “From: $sFrom\n”.”Reply-To: $email\n”.$headers);
else {
$to = explode(“;”,$to);
reset ($to);
while (list($i,$emailTo)=each($to)){
$errMessValue1=mail($emailTo, “Order from $sourcePage”, $sBody, “From: $sFrom\n”.”Reply-To: $email\n”.$headers);
}
}
//echo “Sent:$errMessValue1=$sFrom -> $to
“;
$_POST[‘save_order’]=2;
}
else {
$_POST[‘save_order’]=1;
echo “

$sLang: “;
reset ($aLang);
while (list($i,$v)=each($aLang)){
if ($i<>$_SESSION[‘order_lang’]) {
if (strstr($link,”?”)==””) echo “$v  “;
else echo “$v  “;
}
else echo “$v  “;
}
echo “

“;
?>