Location: PHPKode > scripts > WH Social > wh_social/contact.php
<?php require('framework/session.php'); ?>
<?php require('style/layout/header.php'); ?>

<div id="content_wrapper">
    <div class="content">

    <?php

        echo '<h1>' . $lang['contact'] . '</h1>';

        include_once('framework/functions/captcha.php');

    	if($_SERVER['REQUEST_METHOD'] != 'POST') {

        echo '<form id="contact" name="contact" method="post" action="contact.php">
        <p><input type="text" name="name" class="textfields" required size="40" maxlength="70"> ' . $lang['name'] . ' *</p>
        <p><input type="text" name="from" class="textfields" required size="40" maxlength="90"> ' . $lang['e_mail_adress'] . ' *</p>
        <p><input type="text" name="homepage" class="textfields" size="40" maxlength="100"> ' . $lang['homepage'] . '</p>
        <p><input type="text" name="reason" class="textfields" required size="40" maxlength="100"> ' . $lang['subject'] . ' *</p>
        <p>' . $lang['message'] . ' *<br>
        <textarea name="text" class="textareas"></textarea></p>
        <p><span class="small">Captcha *</span><br>
        ' . $lang['the_sum_of'] . ' ' . $random1 . ' + ' . $code . ' = <input size="3" name="zip" id="Spamschutz" type="text" class="captchas" required><input type="hidden" name="zip2" value=' . $rand_result . '></p>
        <p><input name="to" type="hidden" value="' . $webmaster . '">
        <input type="submit" name="' . $lang['send'] . '" value="' . $lang['send'] . '" class="buttons"></p>
        </form>';

            }else{

            if(sha1($_POST["zip"]) != $_POST["zip2"]) {

            echo '<p class="false">' . $lang['captcha_invalid'] . ' - <a href="contact.php" class="false_link">' . $lang['back'] . '</a></p>';

            }else{

            $errors = array();

            if(isset($_POST['name'])) {
            if(strlen($_POST['name']) > 30) {
            $errors[] = $lang['not_be_longer'];
            }

                }else{

                $errors[] = $lang['name_must_be_filled'];
                }

            if(isset($_POST['from'])) {
            $from = mysql_escape_string($_POST['from']);
            if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $from)) {
            $errors[] = $lang['invalid_syntax'];
            }

                }else{

                $errors[] = $lang['email_must_be_filled'];
                }

            if(isset($_POST['reason'])) {
            if(strlen($_POST['reason']) > 30) {
            $errors[] = $lang['subject_too_longer'];
            }

                }else{

                $errors[] = $lang['subject_must_be_filled'];
                }

            if(!empty($errors)) {

            echo '<p class="false">' . $lang['not_filled_in_all_fields'] . ' - <a href="contact.php" class="false_link">' . $lang['back'] . '</a></p>';
            echo '<ul>';

            foreach($errors as $key => $value) {
            echo '<li>&#8226; ' . $value . '</li>';
            }
            echo '</ul>';

                }else{

                $to = $webmaster;
                include_once('framework/functions/sendmail.php');
                }
            }
        }

	?>

<?php require('style/layout/footer.php'); ?>
Return current item: WH Social