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

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

?>

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

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

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

<h3>Edit News In Database:</h3><p>

<?php

// query the DB

$sql = "SELECT * FROM news WHERE news_id=$id";
$result = mysql_query($sql);	
$myrow = mysql_fetch_array($result);

if (isset($submit)) {

//process form

$sql2 = "DELETE FROM news WHERE news_id=$id";
$result = mysql_query($sql2);

echo "Thank you.  Your information has been deleted.\n";

	
} else {

//display form

?>

<form method="post">
<table width=500px border=0>
<tr>
<td>Teacher ID:
<td><input type="text" id="text" name="postby" value="<?php echo $myrow["teacher_id"] ?>">
<tr>
<td>Subject:
<td><input type="text" id="text" name="subject" value="<?php echo $myrow["subject"] ?>">
<tr>
<td>Message:
<td><textarea rows="5" cols="55" id="text4" name="message" value="none"><?php echo $myrow["message"] ?></textarea>
</table>

<input type="Submit" name="submit" value="Delete Record">

</form>

<?php

}  //end if

?>

<? INCLUDE("bottom.php")?>
Return current item: PortalXP - Teacher Edition