Location: PHPKode > projects > Helpdesk Over Web > how/kb/edit.php
<?php
// Allows Editing of Solution Entries

// Include Configuration File
require_once('../includes/config.inc');

// Set Page Title and Include HTML Header
$page_title = 'HOW - Edit KB Entry';
include_once('../includes/header.html');

// Connect to Database
require_once ('../includes/mysql_connect.php');

// Query the database.
$entryid = $HTTP_GET_VARS['entry'];
$query = "SELECT * FROM knowledgebase WHERE solutionid='$entryid';";		
$result = mysql_query($query)
   or die("Invalid query: " . mysql_error());
list ($solutionid, $category, $title, $keywords, $problemtext, $solutiontext, $lastmodified)= mysql_fetch_row($result);
echo "<H1>Edit Catalogue Entry</H1>";
echo "<FORM METHOD='POST' ACTION='edit-process.php'>";
echo "<P><B>Title:</B> &nbsp;&nbsp;<input type='text' name='title' value = '$title' size='60' maxlength='100'></P>";
echo "<P><B>Category:</B> &nbsp;&nbsp;<select name='category'>";
	$sql = "SELECT * FROM kbcategories WHERE categorytext!='$category' ORDER BY categorytext;";
	$catlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	echo "<OPTION SELECTED>$category</OPTION>";
	while($i = mysql_fetch_row($catlist)) 
		{ 
		echo "<OPTION>$i[1]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Keywords:</B> &nbsp;&nbsp;<input type='text' name='keywords' value = '$keywords' maxlength='100' size='50'></P>";
echo "<P><B>Problem:</B> &nbsp;&nbsp;<BR><textarea name='problemtext' cols='60' rows='10'>$problemtext</textarea></P>";
echo "<P><B>Solution:</B> &nbsp;&nbsp;<BR><textarea name='solutiontext' cols='60' rows='10'>$solutiontext</textarea></P>";
echo "<P><B>Last Modified:</B> &nbsp;&nbsp;$lastmodified";
echo "<input type='hidden' name='entryid' value = '$entryid' size = '15'></P>";
echo "<input type='submit' value='Submit Changes'> &nbsp; [ <A HREF='delete.php?entry=$entryid'>Delete Entry</A> ]";

echo ("<H5>[ <A HREF='kbadmin.php'>Knowledgebase Administration Menu</A> ]</H5>");
echo ("<H5>[ <A HREF='../index.php'>Main System Menu</A> ]</H5>");
// Include HTML footer.
include_once('../includes/footer.html');
?>
Return current item: Helpdesk Over Web