Viewing file: contact.phtml (4.83 KB) -rwxrwxr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include('ax5.inc'); require_once ("recaptchalib.php"); // get a key at http://mailhide.recaptcha.net/apikey $publickey = '6LcMQb0SAAAAACQI_QEpYG5khw2ODmxVnWekKIoV'; $privatekey = '6LcMQb0SAAAAACmUaSL1gx51SsXDKM36KnilxzNu'; disp_preamble('Ax Forum','Contact Us'); echo "<script type=\"text/javascript\" src=\"js/contact.js?v1\"></script>\n"; if (isset($_REQUEST['action'])) $action = $_REQUEST['action']; else $action = '';
if (isset($_SESSION['username'])) $ax_name = $_SESSION['username']; else $ax_name = '';
if (isset($_POST['real_name'])) $real_name = $_POST['real_name']; else $real_name = '';
if (isset($_COOKIE['name'])) $name = $_COOKIE['name']; else $name = '';
if (isset($_POST['email'])) $email = $_POST['email']; else $mail = '';
if (isset($_POST['note'])) $ax_name = $_POST['note']; else $note = '';
if (isset($_SESSION['username'])) $session_username= addslashes($_SESSION['username']); else $session_username = '';
if (isset($_SESSION['login'])) $logged_in= $_SESSION['login']; else $logged_in = FALSE;
switch ($action) {
case "login" : login_session($_POST['username'],$_POST['pw']); //register_visit(); //display_topics(); break;
case "logout" : logout_session(); //register_visit(); //display_topics(); break;
case "Send E-mail": $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) { die ("<div id=\"contactResult\"><h2>The reCAPTCHA wasn't entered correctly.</h2><p>Click back in your browser and try it again.</p></div>"); } $mailstring = "-----------------------------------\n". "Email: ".$email."\n". "Username: ".$ax_name."\n". "Name: ".$real_name."\n". "IP address: ".$_SERVER['REMOTE_ADDR']."\n". "-----------------------------------\n". "message: ".$note."\n". "-----------------------------------\n"; mail('axteam@axkickboxing.com','Ax Contact Form: '.trim($ax_name)." | ".trim($real_name),$mailstring,"From: ".trim($email) ); echo "<div id=\"contactResult\"><h2>Your Message has been sent to the Ax Team.</h2><p>We will contact you shortly.</p></div>"; break; default: ?>
<div id="contact"> <form id="contactForm" action="<? echo $root_web; ?>/contact.phtml" method="post"> <!-- used to protect against spam bots --> <input type="hidden" name="name" value="" /> <input type="text" name="email_address" value="" style="display: none;" /> <!-- used to protect against spam bots --> <ul> <li> <label for="ax_name">Ax UserName</label> <input type="text" name="ax_name" id="ax_name" value="<? echo $ax_name; ?>" /> </li> <li> <label for="real_name">Real Name</label> <input type="text" name="real_name" id="real_name" /> </li> <!-- <li> <label for="phone">Phone</label> <input type="text" name="phone" id="phone" /> </li> --> <li> <label for="email">E-mail</label> <input type="text" name="email" id="email" /> </li> </ul> <ul> <li> <label for="note">Message:</label>
<textarea name="note" id="note" rows="10" cols="12"></textarea> </li> </ul> <div id="captcha"> <?php echo recaptcha_get_html($publickey); ?> </div> <div id="submitButton"><input id="getStartedSubmit" name="action" type="submit" value="Send E-mail" /></div> </form> </div>
<? break; } disp_tail(); ?>
|