Location: PHPKode > scripts > News Script > news-script/admin/addNewsForm.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Add News</title>

<h1>Add News</h1>
<form method="post" action="<?php $_SERVER['PHP_SELF']?>">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
    <td><input type="text" name="txtAuthor" /></td>
    <td><textarea name="txtContent" cols="60" rows="5"></textarea></td>
    <td><input type="submit" name="Submit" value="Submit" /></td>

	if(!empty($_POST['txtAuthor']) && !empty($_POST['txtContent']))

		include ('../NewsScript.php');

		$news = new NewsScript();
		 * notice we don't deal with bad input here, 
		 * the NewsScript object does this for us using our clean() function
		$news->addNews($_POST['txtAuthor'], $_POST['txtContent']);
		echo "Please complete the form.";
Return current item: News Script