Location: PHPKode > scripts > WH Board > wh_board/reply.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="reply.php" class="actual"><?php echo $lang['reply']; ?></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

		if((isset($_GET['id'])) && (is_numeric($_GET['id']))) {

		$id = mysql_real_escape_string($_GET['id']);
		$id = intval($_GET['id']);

			}else{

			echo '<p>' . $lang['invalid_id'] . '!</p>';
			exit();
			}

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

        echo '<p class="false">' . $lang['not_called_directly'] . '!</p>';

			}else{

			include_once('functions/secure.php');
			protect_vars();

			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{

		if(!$_SESSION['signed_in']) {

        echo '<p class="false">' . $lang['you_have_to'] . ' <a href="signin.php">' . $lang['small_signin'] . '</a>.</p>';

    		}else{

    		$errors = array();

    		if(isset($_POST['reply'])) {
    		if(trim($_POST['reply']) == "") {
    		$errors[] = $lang['enter_a_text'];
    		}

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

		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{

			$sql = "INSERT INTO 
						posts(post_content,
						post_date,
						post_topic,
						post_by) 
					VALUES ('" . mysql_real_escape_string($_POST['reply']) . "',
						NOW(),
						'" . $id . "',
						'" . (int)$_SESSION['user_id'] . "')";

			$result = mysql_query($sql) OR die(mysql_error());

		if(!$result) {

		echo '<p class="false">' . $lang['topic_reply_failed'] . '</p>';

			}else{

			$autoforward = 3;

            echo '<p class="success">' . $lang['topic_reply_success'] . '!</p>
            <p><meta http-equiv="refresh" content="' . $autoforward . '; URL=topic.php?id=' . $id . '"></p>
            <p><a href="topic.php?id=' . $id . '">' . $lang['go_on'] . '</a></p>';
            }

        }}}}

	?>

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