Article by - 2012/03/13

[exec]
if( isset($_POST[‘daily’]) and !empty($_POST[‘daily’]) ) { $daily = 1; } else { $daily = ”; }

if( function_exists(‘rep_accents’) ) { $first_name = rep_accents($_POST[‘first’]); $last_name = rep_accents($_POST[‘last’]); } else { $first_name = $_POST[‘first’]; $last_name = $_POST[‘last’]; }

if( isset($_POST[’email’]) and !empty($_POST[’email’]) and !empty($first_name) and $first_name != ‘First Name’ and !empty($last_name) and $last_name != ‘Last Name’ and !empty($_POST[‘tmp’]) and $_POST[‘tmp’] == ’42’ ) {
if( filter_var($_POST[’email’], FILTER_VALIDATE_EMAIL) ) {

echo ‘ ‘;
echo ‘Your subscription to Fastener Weekly newsletter has been well done.’;

$query = array();
$query[‘ma-form-element-yui_3_8_1_1_1363171654088_460’] = $first_name;
$query[‘ma-form-element-yui_3_8_1_1_1363171654088_989’] = $last_name;
$query[‘ma-form-element-yui_3_8_1_1_1363171654088_1241′] = $_POST[’email’];
$query[‘ma-form-element-yui_3_8_1_1_1363171654088_1493’] = $_POST[‘country’];
$query[‘ma-form-element-yui_3_8_1_1_1363171654088_1745’] = $_POST[‘current_url’];
$query[‘ma-form-element-yui_3_8_1_1_1363171654088_3465’] = (empty($daily) ? ‘No’ : ‘Yes’);
$query[‘form_id’] = ‘b07f2556-46d0-477d-b9f8-5345d396986e’;
$query[‘__mauuid’] = $_COOKIE[‘__mauuid’];

$options = array();
$options[‘http’] = array();
$options[‘http’][‘method’] = “POST”;
$options[‘http’][‘header’] = “Accept-language: en\r\n”.”Content-type: application/x-www-form-urlencoded\r\n”;
$options[‘http’][‘content’] = http_build_query($query);

$context = stream_context_create($options);
@fopen(‘https://apps.webmecanik.com/data/public/IncomingForm/Ma/submit’,’r’,false,$context);
} else {
echo “Error during subscription : your email address is wrong”;
echo ‘Please check your email address : ‘.$_POST[’email’].”;
}
} else {
echo ‘If you want to subscribe to our newsletter, please use the form in the sidebar.’;
echo ‘Your first name, last name and email address are required.’;
}
[/exec]