Location: PHPKode > scripts > WH Board > wh_board/contact.php
<?php require('style/layout/header.php'); ?>

    <div class="content_left">
        <ul id="breadcrumbs">
            <li><a href="index.php"><?php echo $lang['main_page']; ?></a></li>
            <li><a href="contact.php" class="actual"><?php echo $lang['contact']; ?></a></li>
        </ul>
    </div>
    <div class="content_right"><form method="post" id="search" action="search.php?search">
        <input type="text" name="search" placeholder="<?php echo $lang['enter_search_term']; ?>..." class="searchfield">
        <input type="hidden" name="submit" value="<?php echo $lang['search']; ?>" alt="<?php echo $lang['search']; ?>">
        </form>
    </div>

    <div class="clear"></div>

    <div id="headline">&nbsp;</div>

    <?php

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

		include_once('functions/flood.php');

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

        echo '<form id="contact" name="contact" method="post" action="">
        <p><input type="text" name="name" class="textfields" size="40" maxlength="70"> ' . $lang['blank_name'] . '*</p>
        <p><input type="text" name="from" class="textfields" size="40" maxlength="90"> ' . $lang['email_adress'] . '*</p>
        <p><input type="text" name="homepage" class="textfields" size="40" maxlength="100"> Homepage</p>
        <p><input type="text" name="reason" class="textfields"size="40" maxlength="100"> ' . $lang['subject'] . '*</p>
        <textarea cols="45" rows="8" name="text" id="text" class="textareas"></textarea>
        <p><small>' . $lang['spam_protection'] . '*</small><br>
        <strong>' . $lang['the_sum_of'] . ' ' . $random1 . ' + ' . $code . ' =</strong> <input size="5" name="zip" id="Spamschutz" type="text" class="protection"><input type="hidden" name="zip2" value=' . $rand_result . '></p>
        <input name="to" type="hidden" value="' . $webmaster . '">
        <input type="submit" name="Senden" value="' . $lang['send'] . '" alt="' . $lang['send'] . '" class="buttons"></p>
        </form>';

			}else{

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

			echo '<p class="false">' . $lang['spam_failed'] . '!</p>
            <p>[ <a href="javascript:history.back();">' . $lang['back'] . '</a> ]</p>';

		}else{

		$errors = array();

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

			}else{
			$errors[] = $lang['reg_fill_name'];
			}

		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['fill_in_email'];
			}

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

			}else{
			$errors[] = $lang['subject_not_entered'];
			}

		if(!empty($errors)) {

		echo '<p class="false">' . $lang['not_filled_all'] . '</p>
		<p><a href="javascript:history.back();">' . $lang['back'] . '</a></p>';
		echo '<ul>';

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

			}else{

			$to = $webmaster;

			include_once('functions/sendmail.php');

			sendmail();
            }
        }
        }

	?>

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