Location: PHPKode > projects > phpCAMALEO > Contact.php
<?php
/***************************************************************************
 *	Contact.php
 *
 *	begin		: June 2004
 *	version		: 27 July 2006
 *	copyright	: (C) 2004,2005 grandolini.net
 *
 *	Contact page
 *
 ***************************************************************************/
$isForm=true;
include('Session.php');

if(isset($_GET[email]) && ($user_email=='' || !isset($user_email)))
{
	$user_email=$_GET[email];
}
if(isset($_POST[submit]) && $_POST[submit]==B_SEND)
{
	$user_email	=$_POST[email];
	$object		=$_POST[object];
	$message	=$_POST[message];

	$feedback=contact($_POST[email], $_POST[object], $_POST[message]);
	if($feedback=='OKIDOKI')
	{
		include($_SESSION[common].'includes/PrepareHttp.php');
		header($http_header.'LoadPage.php?page=600');
		#-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	}
	else { list($feedback_str,$err_i)=explode('#@#',$feedback); }
}
else { $feedback_str=''; }

$PageNr='contact';
$_SESSION[PageNr]=strtolower($PageNr);
$_SESSION[PageFile]=basename($_SERVER[PHP_SELF]);
$_SESSION[ReturnPage]=basename($_SERVER[PHP_SELF]);

include($_SESSION[skinf].'Layout.php');

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Send email to site administrator
#
function contact($user_email, $object, $message)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
	include($_SESSION[common].'fun2inc/validate_email.inc');
	include($_SESSION[common].'fun2inc/emailer.inc');

	$feedback=validate_email($user_email);

	if($feedback!='valid') { return($feedback.'#@#1'); }
	if($object=='')		{ return(BuildErrorString(1011).'#@#2'); }
	if($message=='')	{ return(BuildErrorString(1011).'#@#3'); }
	#
	if($_POST[cc]=='')	{ $result=emailer($_SESSION[misc][E_ADMIN],str_replace('\\','',$object),str_replace('\\','',$message),$user_email); }
	else				{ $result=emailer($_SESSION[misc][E_ADMIN],str_replace('\\','',$object),str_replace('\\','',$message),$user_email,$user_email); }
	if($result=='*OK*') { return 'OKIDOKI'; } else { return(BuildErrorString(1504,1500)); }
}
?>
Return current item: phpCAMALEO