HEX
Server: Apache
System: Linux iad1-shared-e1-24 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: dh_ncpy7d (5150532)
PHP: 8.2.26
Disabled: NONE
Upload Files
File: /home/dh_ncpy7d/beitarbeersheva.com/campaign/contact.php
<?php
	If(isset($_POST['name']))
	{
		$name = $_POST["name"];
		$email = $_POST["email"];
		$phone = $_POST['phone'];
		$mobile = $_POST['mobile'];
		$isMobile = ($mobile ? "כן" : "לא");
		$ref = $_POST['ref'];
		
		$visitorFrom = $_POST['leedSrc'];
		if($_POST['confirm']=="true")
		{
			$allowMailing = "כן";
		}
		else
		{
			$allowMailing = "לא";
		}
		$leedText = "";
		if($visitorFrom != "")
		{
			$leedText = "index.php?src=" . $visitorFrom;
		}

		$msg = "שם: " . $name . "<br />טלפון: " . $phone . "<br />מובייל: " .  $isMobile . "<br />כתובת דף הנחיתה: http://beitarbeersheva.com/campaign/" . $leedText;

		$headers  = "MIME-Version: 1.0\r\n";
		$headers .= "Content-type: text/html; charset=UTF-8\r\n";

		mail('simotb@gmail.com' ,'לייד חדש מטניס שולחן' , $msg, $headers);
		
		////////////////////////////////////////////////////////////////////////////////////
		
		date_default_timezone_set('Asia/Jerusalem');
		$date = date("Y-m-d H:i:s");
		
		if (!empty($_SERVER['HTTP_CLIENT_IP'])) 
		{
			$ip = $_SERVER['HTTP_CLIENT_IP'];
		} 
		elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) 
		{
			$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
		} 
		else 
		{
			$ip = $_SERVER['REMOTE_ADDR'];
		}
		
		$moreDetails = $_SERVER['HTTP_USER_AGENT'];

		$servername = "mysql.beitarbeersheva.com";
		$username = "beitarbeershevac";
		$password = "-j93pzZ6";
		$dbname = "beitarbeersheva_com";

		
		// Create connection
		$conn = mysqli_connect($servername, $username, $password, $dbname);
		// Check connection
		if ($conn->connect_error) {
			die("Connection failed: " . $conn->connect_error);
		}
		// Change character set to utf8
		mysqli_set_charset($conn,"utf8");
		
		$sql = "INSERT INTO leeds (ip, dateTime, leadName, leadPhone, isMobile, visitorFrom, ServerReference, moreDetails) VALUES ('$ip', '$date', '$name', '$phone', '$isMobile', '$visitorFrom', '$ref', '$moreDetails');";
		
		/*	//sql to file
		$date=date_create(date(c));
		$file = "Log/" . date_format($date,"d-m-Y-H_i_s") . "Registr.txt"; // File name
		$myfile = fopen($file, "w") or die("Unable to open file!");
		$txt = $sql;
		fwrite($myfile, $txt);
		fclose($myfile);*/
			
		$conn->query($sql);
		$conn->close();
	}
	
?>