Esempio n. 1
0
    $nStr = $str;
    $nStr = str_replace("**am**", "&", $nStr);
    $nStr = str_replace("**pl**", "+", $nStr);
    $nStr = str_replace("**eq**", "=", $nStr);
    return stripslashes($nStr);
}
if ($_GET['contact'] == true && $_GET['xml'] == true && isset($_POST['posText'])) {
    $to = $yourName;
    $subject = ajaxcontact_subject . cleanPosUrl($_POST['posRegard']);
    $message = cleanPosUrl($_POST['posText']);
    $headers = "From: " . cleanPosUrl($_POST['posName']) . " <" . cleanPosUrl($_POST['posEmail']) . ">\r\n";
    $headers .= 'To: ' . $yourName . ' <' . $yourEmail . '>' . "\r\n";
    $mailit = mail($to, $subject, $message, $headers);
    if (@$mailit) {
        $posStatus = 'OK';
        $posConfirmation = 'Success! Your Email has been sent. Hope you enjoyed your stay.';
    } else {
        $posStatus = 'NOTOK';
        $posConfirmation = 'Your Email could not be sent. Please try back at another time.';
    }
    if ($_POST['selfCC'] == 'send') {
        $ccEmail = cleanPosUrl($_POST['posEmail']);
        @mail($ccEmail, $subject, $message, "From: Yourself <" . $ccEmail . ">\r\nTo: Yourself");
    }
    echo '
		<status>' . $posStatus . '</status>
		<confirmation>' . $posConfirmation . '</confirmation>
		<regarding>' . cleanPosUrl($_POST['posRegard']) . '</regarding>
		';
}
echo '	</resultset>';
Esempio n. 2
0
<?php

include_once '../ajaxcontact_settings.php';
// Change the 4 variables below
$yourName = ajaxcontact_yourname;
$yourEmail = ajaxcontact_youremail;
$yourSubject = ajaxcontact_subject;
// No need to edit below unless you really want to. It's using a simple php mail() function. Use your own if you want
function cleanPosUrl($str)
{
    return stripslashes($str);
}
if (isset($_POST['sendContactEmail'])) {
    $to = $yourEmail;
    $subject = $yourSubject . cleanPosUrl($_POST['posRegard']);
    $message = cleanPosUrl($_POST['posText']);
    $headers = "From: " . cleanPosUrl($_POST['posName']) . " <" . $_POST['posEmail'] . ">\r\n";
    $headers .= 'To: ' . $yourName . ' <' . $yourEmail . '>' . "\r\n";
    $mailit = mail($to, $subject, $message, $headers);
    if (@$mailit) {
        header('Location: ' . $referringPage . '?success=true');
    } else {
        header('Location: ' . $referringPage . '?error=true');
    }
}