Location: PHPKode > projects > Warp.cms - php/mysql content management > warp_121/admc_op.php
<?php

// [administrator contact / company contact - operantions module v.1.2.1] 
// xantis.warp.cms - version 1.2
// (c) 2002 xantis - all rights reserved
// this code is registered and protected by international copyrights laws


//####### Register Globals !

extract($HTTP_ENV_VARS);
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);

//#########################

$ysecure = rawurldecode($ysecure);
$ysecure = base64_decode ($ysecure);
if ($ysecure == 'admfrmok') {
	$xnt_control_var = 'xnt2002warp.cms';
} //end if

if (empty($yfilename)) {
	$yfilename = 'admc_op.php';
} //end if

require("lib_adv.php");


//##################################################


function xadmc_operate () {

global	$name_var, $msg_var, $email_var ;

global	$ywusr_adm_cont_min_name, $ywusr_adm_cont_min_msg,
	$ywusr_adm_cont_err_01, $ywusr_adm_cont_err_02,
	$ywusr_err_04, $ywusr_adm_cont_oky, $y_warp_admin_email,
	$ywusr_adm_cont_frm_name, $ywebsite_name, $y_warp_office_email,
	$ywusr_adm_cont_xname, $ywusr_adm_cont_xemail, $ywusr_adm_cont_xmsg,
	$ywebsite_addr, $y_warp_xdate, $y_warp_xtime, $yprods_item_askfordetails,
	$y_warp_events_contacting, $ywusr_adm_cont_frm_name_ofx ;

global	$REQUEST_METHOD, $QUERY_STRING, $y_warp_direct_file_acc_msg_reff ;

global $xcntyp, $xcnt_subj;


//-----------------------------

//---------------------
if (empty($xcntyp)) {
   $xcntyp = 'admin';
} //end if
//---------------------


//############################## operation admin / office

if ($xcntyp == 'admin') {

	$hvb_local_email_to = $y_warp_admin_email;

} //end if

if ($xcntyp == 'offx') {

	$hvb_local_email_to = $y_warp_office_email;

} //end if

//###################################

//assure
if (empty($hvb_local_email_to)) {

	$hvb_local_email_to = $y_warp_admin_email;

} //end if

//##############################



$email_var = trim ($email_var);
$name_var = trim ($name_var);

$msg_var = trim ($msg_var);
$msg_var = stripslashes("$msg_var");
$msg_var = ereg_replace ("\r\n", "\n", "$msg_var");
$msg_var = ereg_replace ("\r", "\n", "$msg_var");

$xcnt_subj = stripslashes($xcnt_subj);

$y_process_usr_err = 'ok';


	//check request method
	if ( ($REQUEST_METHOD <> 'POST') OR (!empty($QUERY_STRING)) ) {
		if ($y_process_usr_err == 'ok') {
			$xcheck_var_xerr = $y_warp_direct_file_acc_msg_reff;
		} //end if
		$y_process_usr_err = 'notok';
	} //end if


	//check name
	if (strlen($name_var) < $ywusr_adm_cont_min_name) {
		if ($y_process_usr_err == 'ok') {
			$xcheck_var_xerr = $ywusr_adm_cont_err_01;
		} //end if
		$y_process_usr_err = 'notok';
	} //end if


	//check message
	if (strlen($msg_var) < $ywusr_adm_cont_min_msg) {
		if ($y_process_usr_err == 'ok') {
			$xcheck_var_xerr = $ywusr_adm_cont_err_02;
		} //end if
		$y_process_usr_err = 'notok';
	} //end if


	//check email
	if (!stristr($email_var, '@')) {
		if ($y_process_usr_err == 'ok') {
			$xcheck_var_xerr = $ywusr_err_04;
		} //end if
		$y_process_usr_err = 'notok';
	} //end if
	if (!stristr($email_var, '.')) {
		if ($y_process_usr_err == 'ok') {
			$xcheck_var_xerr = $ywusr_err_04;
		} //end if
		$y_process_usr_err = 'notok';
	} //end if


	//if ok all mail data
	if ($y_process_usr_err == 'ok') {

		mail("$hvb_local_email_to", 
			"$ywebsite_name : $xcnt_subj", 
				"$ywusr_adm_cont_xname : $name_var"."\n".
				"$ywusr_adm_cont_xemail : $email_var"."\n".
				'-----------------------------------'."\n".
				"$ywusr_adm_cont_xmsg :"."\n"."$msg_var"."\n".
				'-----------------------------------'."\n".
				"$y_warp_xdate".'  -  '."$y_warp_xtime"."\n".
				"$ywebsite_addr"."\n".
				'-----------------------------------'."\n"
		);
	} //end if



echo(
	"&xcheck_load_controlvar=".rawurlencode('ok').
	"&xcheck_data_controlvar=".rawurlencode($y_process_usr_err).
	"&flash_form_text_err=".rawurlencode($xcheck_var_xerr).
	"&flash_form_text_oky=".rawurlencode("$ywusr_adm_cont_oky").
	"&"
);


} //end function


//------------------------------------------------

if ($ysecure == 'admfrmok') {
	xadmc_operate ();
} //end if

//------------------------------------------------


// end of php code
?>
Return current item: Warp.cms - php/mysql content management