Update of /cvsroot/openfirst/news/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv22781/admin
Added Files:
addnews.php
Log Message:
initial upload
--- NEW FILE: addnews.php ---
<?php
/*
* openFIRST.news - addnews.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: Tim Ginn <tim...@sy...>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
include("../config/globals.php");
include($header);
membersmenu($user->membertype);
echo("<h1>Add News</h1>");
if($user->membertype == "administrator") {
if($_POST["news"] == "") {
// Display a form for news.
?>
<form method="post" action="addnews.php">
Message Title: <input name="title" type="text" value="openFIRST News">
<br />Message:
<br /><textarea name="news" cols="40" rows="20">Insert your news here.</textarea>
<br />
<input type="submit" value="Add News Item" />
<input type="reset" value="Clear News Item" />
</form>
<?php
} else {
// Add the news.
// $_POST["news"], $_POST["title"]
$now = date("D M j G:i:s T Y");
$query = mysql_query("INSERT INTO
ofirst_news (date, poster, title,
news) VALUES ('$now', '$user->user', '" .
$_POST["title"] . "', '" .
$_POST["news"] . "');");
echo("The news item " . $_POST["title"]
. " has been added.");
}
} else {
echo("You must be logged on as an
administrative user to add news.");
}
include($footer);
?>
|