Location: PHPKode > scripts > WH Social > wh_social/comment.php
<?php

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

    echo '<form action="" method="post" name="pb">
    <p>' . $lang['pb_new_pinentry'] . '<br>
    <textarea name="post" class="pinarea"></textarea></p>
    <p><input type="submit" class="buttons" value="' . $lang['to_publish'] . '" name="' . $lang['to_publish'] . '"></p>
    </form>';

    	}else{

        $errors = array();

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

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

        if(!empty($errors)) {

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

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

        	}else{

        	$sql = "INSERT INTO
        				pinboard(id2, post, date)
        			VALUES ('" . (int)$_SESSION['id'] . "',
        				'" . mysql_real_escape_string($_POST["post"]) . "',
        				NOW()
        				)";

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

        if(!$result) {

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

        	}else{

        	$autoforward = 3;

        	echo '<p class="success">' . $lang['success_pb_entry'] . ' - <a href="pinboard.php?id=' . $id . '" class="success_link">' . $lang['go_on'] . '</a></p>
            <meta http-equiv="refresh" content="' . $autoforward . '; URL=pinboard.php?id=' . $id . '">
            <p><em>(' . $lang['redirected_in'] . ' ' . $autoforward . ' ' . $lang['seconds'] . '...)</em><p>';
            }
        }
    }

?>
Return current item: WH Social