Location: PHPKode > projects > phpBlogger > admin/faq.php
<?php
##############################
# pages.php      version 1.1.#
##############################
include ('header.php');
?>
<div id="headermenu">FAQ</div>
<script type="text/javascript" src="nicEdit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<?php
if(isset($_POST['submit'])) {
	$question = $_POST['question'];
	$answer = $_POST['answer'];
	if(get_magic_quotes_gpc()) {
		$question = stripslashes($question);
		$answer = stripslashes($answer);
	}
$question = htmlspecialchars($question);
$answer = htmlspecialchars($answer);
$sql = $conn->Prepare('INSERT INTO helptopics (faqestion,faqanswer) VALUES (?, ?)');
if($conn->Execute($sql,array($question,$answer)) === false) {
		print '<br /><div id="error">error inserting[1]: '.$conn->ErrorMsg().'</div><br />';
	}
$conn->Close();
	echo "<div id ='information'>&nbsp;Successfully. ";
    ?>
<a href="faq.php">Back to FAQ.</a></div>
<?php } else { ?>
<form method="post" action="faq.php">
Question:<br />
<input id="incc" type="text" name="question" />
<br /><br />
Answer:<br /><textarea id="incc" style="height:333px" name="answer"></textarea><br /><br />
<br /><br />

<input type="submit" class="topicbuton" name="submit" value="Submit" /><br /><br />
</form>
<?php
$conn->Close();
}
?>
</div></div></div>
<?php include ('footer.php'); ?>
Return current item: phpBlogger