Location: PHPKode > projects > Wiki-Map > htdocs/addfaq.php
<?
// ----------------:: Adds questions and answers to faq table ::------------
if (isset($_POST[add])){
		include 'openDB.php';
		$q = addslashes($_POST[q]);
		$a = addslashes($_POST[a]);
		$sql="INSERT INTO faq (cat,q,a) VALUES ('$_POST[cat]','$q','$a')";
		$result = mysql_query($sql);
		if (!$result){
			echo '** Creation falied ** '.mysql_error().'<BR>\n';
		} else {echo "<H2>Information added!</H2>";}
	} 
// -----------------------: Display form :-----------------------------------
	echo <<<END
		<FORM ACTION=# METHOD='POST'>
			<TABLE>
				<TR><TD colspan=2>
				Question:<BR>
				<TEXTAREA ROWS=3 COLS=120 NAME=q>
				Type your question here...
				</TEXTAREA>
				</TD></TR>
				<TR><TD>
				<P>Answer:<BR>
				<TEXTAREA ROWS=15 COLS=100 NAME=a>
				Type your answer here...
				</TEXTAREA>
				</TD><TD>
				<INPUT type=radio name=cat value=1-General default>General<BR>
				<INPUT type=radio name=cat  value=2-Usage>Usage<BR>
				<INPUT type=radio name=cat  value=3-Technical>Technical<BR>
				<INPUT type=radio name=cat  value=4-Development>Development<BR>
				<INPUT type=radio name=cat  value=5-Bugs>Bug Reports<BR>
				<INPUT type=radio name=cat  value=6-Commercial>Commercial<BR>
				</TD></TR></TABLE>
				<INPUT type=submit name=add value=ADD>
				<INPUT type=reset name=reset>
		</FORM>
END;
?>
Return current item: Wiki-Map