ob_start();
session_start();
$uIp = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$uBsr = $HTTP_SERVER_VARS["HTTP_USER_AGENT"];
$crntPage = $HTTP_SERVER_VARS["SCRIPT_NAME"];
if(isset($HTTP_SERVER_VARS['HTTP_REFERRER'])){
$Referrer = $HTTP_SERVER_VARS['HTTP_REFERRER'];
}else{
$Referrer = "www.xyz.com";
}
$sId = session_id();
///////////////////////////////////////////////////
$host="localhost";
$user="pierllxy_siti";
$password="p@kistan$321";
$db="pierllxy_siti";
////////////////////////////////////////////////////////
$connect = @mysql_connect($host, $user, $password);
mysql_select_db($db);
///////////////////////////////////////////////////////////////////////
$sad=mysql_query("select * from tbl_admin where RecID='1'") or die("Invalid SQL ".mysql_error());
$adrow=mysql_fetch_array($sad);
////////////////////////////////////////////////////////////////////////
$Company=$adrow['fname'];
$CpTitle="Control Panel ( $Company )";
$FSTitle=$adrow['title'];
$EmlTo=$adrow['email'];
$fkeywords=$adrow['keywords'];
$fdescription=$adrow['description'];
$img1="img/ms2.jpg";
$img2="img/mmid.jpg";
$myURL="http://xyz.com/xyz/";
$simgs="sdata/";
$defimg="admincp/";
$bimgs=$simgs."banner/";
$bimgs1=$defimg.$simgs."banner/";
$bsecimgs=$simgs."secbanner/";
$bsecimgs1=$defimg.$simgs."secbanner/";
$secimgs=$simgs."secimgs/";
$secimgs1=$defimg.$simgs."secimgs/";
$mainimgs=$simgs."mainimgs/";
$mainimgs1=$defimg.$simgs."mainimgs/";
$subimgs=$simgs."subimgs/";
$subimgs1=$defimg.$simgs."subimgs/";
$itmimgs=$simgs."itmimgs/";
$itmimgs1=$defimg.$simgs."itmimgs/";
?>
$MSecID='';
$SecID='';
$MainID='';
$SubID='';
$ItmID='';
$Head='';
if(isset($_REQUEST['IDZ'])){
$IDZ=$_REQUEST['IDZ'];
list($ItmID,$SubID,$MainID,$SecID,$MSecID)=split('[-]',$IDZ);
}
$cats="y";
$chat="n";
$radio="n";
$news="n";
$lexchange="n";
$banners="n";
$sqlp="select * from tbl_items where ";
if($MSecID<>''){
$qry=mysql_query("select MSecName from tbl_mainsection where MSecID='".$MSecID."'") or die("Invalid MSecID ".mysql_error());
if($qry){
$rows=mysql_num_rows($qry);
if($rows>0){
$data=mysql_fetch_row($qry);
$Head .=$data[0];
$mn=$data[0];
}
}
mysql_free_result($qry);
}else{
$qry=mysql_query("select * from tbl_mainsection order by rank") or die("Invalid MSecID ".mysql_error());
If(mysql_num_Rows($qry)>0){
$rs=mysql_fetch_array($qry);
$MSecID=$rs["MSecID"];
$Head .="".$rs["MSecName"]." » ";
}
mysql_free_result($qry);
}
$sqlp.= "MSecID='".$MSecID."'";
if($SecID<>''){
$qry=mysql_query("select SecName,SecImg from tbl_section where MSecID='".$MSecID."' and SecID='".$SecID."' order by rank") or die("Invalid MSecID ".mysql_error());
if($qry){
$rows=mysql_num_rows($qry);
if($rows>0){
$data=mysql_fetch_row($qry);
$sn=$data[0];
$Head ="".$mn." » ".$data[0];
}
}
mysql_free_result($qry);
}else{
$qry=mysql_query("select * from tbl_section where MSecID='".$MSecID."' order by rank") or die(mysql_error());
if(mysql_num_rows($qry)>0){
$rs=mysql_fetch_array($qry);
$SecID=$rs["SecID"];
$Head .=$rs["SecName"];
}
mysql_free_result($qry);
}
$sqlp.= " and SecID='".$SecID."'";
if($MainID<>'' && $MainID<>0){
$qry=mysql_query("select MainName,MainImg,PrdType from tbl_main where MSecID='".$MSecID."' and SecID='".$SecID."' and MainID='".$MainID."' order by rank") or die("Invalid MSecID ".mysql_error());
if($qry){
$rows=mysql_num_rows($qry);
if($rows>0){
$data=mysql_fetch_row($qry);
//$Head .=$data[0]."sssss";
$Head = $mn." » ".$sn." » ".$data[0];
}
}
mysql_free_result($qry);
}else{
$qrychk=mysql_query("select * from tbl_main where MSecID='".$MSecID."' and SecID='".$SecID."' order by rank") or die(mysql_error());
if(mysql_num_rows($qrychk)>0){
$rs=mysql_fetch_array($qrychk);
$MainID=$rs["MainID"];
$Head .= $rs["MainName"];
}
mysql_free_result($qrychk);
}
$sqlp.= " and MainID='".$MainID."'";
if($SubID<>'' && $SubID<>0){
$qry=mysql_query("select SubName,PrdType from tbl_sub where MSecID='".$MSecID."' and SecID='".$SecID."' and MainID='".$MainID."' and SubID='".$SubID."'") or die("Invalid MSecID ".mysql_error());
if($qry){
$rows=mysql_num_rows($qry);
if($rows>0){
$data=mysql_fetch_row($qry);
$Head .=$data[0];
}
}
mysql_free_result($qry);
}else{
$qrychk=mysql_query("select * from tbl_sub where MSecID='".$MSecID."' and SecID='".$SecID."' and MainID='".$MainID."' order by rank") or die(mysql_error());
if(mysql_num_rows($qrychk)>0){
$rs=mysql_fetch_array($qrychk);
$SubID=$rs["SubID"];
$Head .=$rs["SubName"];
}
mysql_free_result($qrychk);
}
$sqlp.= " and SubID='".$SubID."' and sOption='y' order by rank";
//echo("".$sqlp."");
?>
function send_mail($from,$to,$cc,$Bcc,$subject,$body,$fileatt,$fileatt_type,$fileatt_name){
$inis = ini_get_all();
if($_SERVER['HTTP_HOST']<>"localhost"){
ini_set('sendmail_from','NULL');
ini_set('default_mimetype','NULL');
ini_set('short_open_tag','On');
}
$headers="MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\nDate: ".date("m-d-Y")."\r\nFrom: ".$from."\r\nCC: ".$cc."\r\nBcc: ".$Bcc."\r\n";
$headers.='mailed-by: '.$from;
if ($fileatt<>"" && is_uploaded_file($fileatt)) {
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n"."Content-Type: multipart/mixed;\n"." boundary=\"{$mime_boundary}\"";
$body = "This is a multi-part message in MIME format.\n\n"."--{$mime_boundary}\n"."Content-Type: text/html; charset=\"iso-8859-1\"\n"."Content-Transfer-Encoding: 7bit\n\n".$body."\n\n";
$data = chunk_split(base64_encode($data));
$body .= "--{$mime_boundary}\n"."Content-Type: {$fileatt_type};\n"." name=\"{$fileatt_name}\"\n"."Content-Disposition: attachment;\n"." filename=\"{$fileatt_name}\"\n"."Content-Transfer-Encoding: base64\n\n".$data."\n\n"."--{$mime_boundary}--\n";
}
if(mail($to,$subject,$body,$headers)){
}else{
print "An error occured while trying to send email. Please try again";
die();
}
}
if(isset($_REQUEST['act']) && $_REQUEST['act']=="qfeedback")
{
$body="
Quick Feedback |
$_REQUEST[name] |
|
$_REQUEST[phone] |
|
$_REQUEST[email] |
|
$_REQUEST[coments] |
|
";
$subject="Quick Feedback at $Company";
//////////////////////////////////////////////////////////////////////////////////////
//$headers = "From: ".$_REQUEST["email"];
//mail($EmlTo, $subject, $body, $headers);
send_mail("$sCompany <$EmlTo>",$_REQUEST["email"],$EmlTo,"",$subject,$body,"","","");
header("Location:contacts.php?mess=Inquiry+Submit+Sucessfully+!");
}
?>
|
Follow us: info@inoxtools.biz | Call now: +92 - 321 -7115317 |
|
|
|
|
|
|
|
|
|
|
|