Location: PHPKode > projects > Wordlog > htdocs/addreply.php
<?
	/* Last Edit: 05/23/03 --> v1.5-FINAL */
	require("include/config.php");
	require("include/language.php");
	require("include/functions.internal.php");
	require("include/functions.html.php");
	require("include/functions.format.php");
	require("include/functions.sessions.php");
	require("include/connect.php");
	$current_page = 'addreply.php';
	$admin_options[] = "";

	if ($_POST[DO_IT] && $_SESSION[LOGGED_IN]) {
		if ($_POST[Message] && $_SESSION[LOGGED_IN]) {
			mysql_query("INSERT INTO ".SQL_TABLEPREFIX."replies (message,cid,pid,from_user,host,sourcet) values ('$_POST[Message]','$_POST[cid]','$_POST[pid]','$_SESSION[LOGGED_IN]','$_SERVER[REMOTE_ADDR]','$_POST[sourcet]')");
		}
		header("Location: $_POST[FORWARD]\n\n");
		exit();
	}
	html_header(HTML_TITLE." :: ".REPLY_ADD_TITLE);
?>

<BODY <? echo html_body() ?> >

<CENTER>
<PRE>
<? 
	echo html_menu($current_page);
	echo html_loggedin($admin_options);

	if (!$_SESSION[LOGGED_IN]) {
		echo format_blank(),format_wrap(GENERIC_NEEDLOGIN,0),format_blank(),format_line(),html_footer(),"\n</PRE>\n";
	}	else {
?>
</PRE>
<FORM ACTION="addreply.php" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="DO_IT" VALUE="1">
<INPUT TYPE="HIDDEN" NAME="FORWARD" VALUE="<? echo $_SERVER[HTTP_REFERER] ?>">
<INPUT TYPE="HIDDEN" NAME="pid" VALUE="<? echo $_GET[pid] ?>">
<INPUT TYPE="HIDDEN" NAME="cid" VALUE="<? echo $_GET[cid] ?>">
<INPUT TYPE="HIDDEN" NAME="sourcet" VALUE="<? echo $_GET[sourcet] ?>">
<TABLE BORDER>
	<TR>
		<TD>
			HTML:
		</TD>
		<TD>
			<? html_textformat() ?>
		</TD>
	</TR>
	<TR>
		<TD><? echo GENERIC_MESSAGE.":" ?></TD>
		<TD><TEXTAREA NAME="Message" ROWS="8" COLS="50" WRAP="VIRTUAL"></TEXTAREA></TD>
	</TR>
	<TR>
		<TD>&nbsp;</TD>
		<TD><INPUT TYPE="SUBMIT" VALUE="<? echo REPLY_ADD ?>"> <? echo html_spellcheck() ?> <? echo html_cancelbutton() ?></TD>
	</TR>
</TABLE>
</FORM><? } ?>

</CENTER>
</BODY>
</HTML>

<? mysql_close($conn) ?>
Return current item: Wordlog