HEX
Server: LiteSpeed
System: Linux lp015.web24.net.au 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
User: pgkdistr (10190)
PHP: 8.1.32
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/pgkdistribution.com.au/citisolar.com.au/website-php/scripts/contact.php
<?php


$referrer_domains = array('localhost','127.0.0.1','statewidehydraulics.com.au');

if ($_SERVER['REQUEST_METHOD']!='POST')
{
	//die('GET Method not allowed in script.');
	//exit;
	header ("Location: ../contact-us.html");
}

if(empty($_POST) AND empty($_GET)){
	die('Unable to obtain HTTP variables - Form processing failed.');
	exit;
}else{
	$hpv =& $_POST;
	$hgv =& $_GET;
	$hvv =& $_SERVER;
	$hpf =& $_FILES;
}


require("class.phpmailer.php");

$mail = new phpmailer();
$mail->From     = "form@statewidehydraulics.com.au";
$mail->FromName = "Website Contact Form";
//$mail->Host     = "210.50.196.39";
$mail->Host = "localhost";
$mail->Mailer   = "smtp";

$mail->AddAddress("sales@statewidehydraulics.com.au");
$mail->AddbCc("ben@marketingandbranding.com.au"); //will be removed on completion of sucessful test



$mail->Subject = "New Contact";
$message  = "A visitor has submitted the following through the Statewide Hydraulics contact form:\n\n";

foreach($_POST as $key=>$value)
{
	if(is_array($value))
	{
		$array_value=$_POST[$key];
		$count=1;
		extract($array_value); 
		foreach($array_value as $part_value) 
		{
			if($count > 1){$value.=", ";}
			$value.=$part_value;
			$count=$count+1;
		}
	}

	$value=stripslashes($value);
	$value=nl2br($value);

	if ($key != "Submit")
	{
		$message .= $key.": ".$value."\n";
	}
}

$mail->Body = $message;
if(!$mail->Send())
{
   //echo "There was an error sending the message";
   header ("Location: ../error.html");
   exit;
}

//echo "Message was sent successfully";
header("Location: ../thankyou.html");
exit;



?>