<?php
if(!function_exists('my_OnBeforeMailSent')) {
function my_OnBeforeMailSent(&$fields) {
global $modx;
// *** Save IP
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$fields['ip'] = $ip;
// *** Get the Get Params
$x = trim(urldecode($_REQUEST["x"]));
// *** Add data to the fields array
$fields['x'] = ($x==""?"UNKNOWN":$x);
return true;
} // End Function
} // End If Function Exists
?>
<p> IP = [+ip+]<br /> X = [+x+] </p>
[!contactform_Routines!] [!eForm? &formid=`contactForm` &to=`[email protected]` &tpl=`contact_Form` &report=`contact_Report` &thankyou=`contact_Thanks` &vericode=`0` &subject=`mySubject` &language=`nederlands` &eFormOnBeforeMailSent=`contact_OnBeforeMailSent` &eFormOnBeforeFormParse=`contact_OnBeforeFormParse` &protectSubmit=`0` !]
if(!function_exists('contact_OnBeforeFormParse')) {
function contact_OnBeforeFormParse(&$fields, &$templates) {
global $modx;
return true;
} // End Function
} // End If function exists
$x = trim(urldecode($_REQUEST["x"]));
//$x = trim(urldecode($_REQUEST["x"]));
$x = $_GET['id']; //let's get the id of the page calling this
Some errors were detected in your form: [undefined] » Tampering attempt detected!
<?php
global $x,$y;
$x = $_GET["x"];
$y = $_GET["y"];
echo $x.'<br/>'.$y.'<br/>';
$y .= 'examplestring';
echo $y.'<br/>';
if(!function_exists('my_OnBeforeMailSent')) {
function my_OnBeforeMailSent(&$fields) {
global $modx, $x, $y;
// *** Get IP
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$fields['ip'] = $ip;
// *** Add data to the fields array
$fields['x'] = $x;
$fields['y'] = $y;
return true;
} // End Function
} // End If Function Exists
?>
test1 test2 test2examplestring
<?php
if(!function_exists('my_OnBeforeMailSent')) {
function my_OnBeforeMailSent(&$fields) {
global $modx;
// *** Get IP
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$fields['ip'] = $ip;
$tempx = explode('&', html_entity_decode(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)));
$tempy = array();
foreach($tempx as $val)
{
$tempz = explode('=', $val);
$tempy[$tempz[0]] = $tempz[1];
}
unset($val, $tempz, $tempx);
// *** Add data to the fields array
$fields['x'] = $tempy['x'];
$fields['y'] = $tempy['y'];
//die(print_r($_SERVER));
return true;
} // End Function
} // End If Function Exists
?>