PHP Classes

File: admin/addNewsForm.php

Recommend this page to a friend!
  Classes of Andrew   News Script   admin/addNewsForm.php   Download  
File: admin/addNewsForm.php
Role: Application script
Content type: text/plain
Description: Add a News Item
Class: News Script
Manage and publish news stored in a MySQL database
Author: By
Last change:
Date: 15 years ago
Size: 1,221 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
    <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>

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

        include (

$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']);
"Please complete the form.";