Location: PHPKode > projects > PortalXP - Teacher Edition > PortalXP/PortalXP/admin/addnews.php
<?PHP

require('config.php');
require('connect.php');

?>

<TITLE><?php echo $domain ?> - Add News</TITLE>

<? INCLUDE("top-mini.php")?>

<link REL="stylesheet" TYPE="text/css" HREF="../portalxp.css">

<h3>Add News To Database:</h3><p>

<?php

if (isset($submit)) {

//process form
$sql = "INSERT INTO news (teacher_id,subject,message) VALUES ('$teacher_id','$subject','$message')";
$result = mysql_query($sql);
echo "Thank you.  Your information has been entered.\n";

} else {

//display form

$sql2 = "SELECT firstname, lastname FROM teacher where teacher_id = $id";
$result2 = mysql_query($sql2);	
$myrow2 = mysql_fetch_array($result2);

?>

<form method="post" action="<?php echo $PHP_SELF?>">
<table width=500px border=0>
<tr>
<td>Teacher ID: 
<td><?php echo $id ?> - <?php echo $myrow2["lastname"] ?>, <?php echo $myrow2["firstname"] ?>
<tr>
<td>Subject:
<td><input type="text" id="text" name="subject">
<tr>
<td>Message:
<td><textarea rows="4" cols="55" id="text4" name="message" wrap="virtual">
</textarea>
<input type="Hidden" name="teacher_id" value="<?php echo $id ?>">
<input type="Submit" name="submit" value="Enter Information">
</table>
	<hr size="1">
	<center><b>Formatting</b></center>
	<pre>
	<b>[b]...[/b]</b>                 Bold
	<b>[i]...[/i]</b>                 Italics
	<b>[pre]...[/pre]</b>             Preformatted
	<b>[indent]...[/indent]</b>       Indented Blocks (blockquote)
	<b>[link="..."]...[/link]</b>     Links (javascript is not permitted)
	</pre>
</form>
<?php
}  //end if
?>
<? INCLUDE("bottom.php")?>
Return current item: PortalXP - Teacher Edition