(root)/trunk/edit_section.php - Редакция 2
Авторство |
Последнее изменение |
Открыть журнал
| RSS
<?PHP
session_start();
if ($_SESSION['$user_privileges'] < 16)
header("Location: index.php");
include "head.php";
$section_id = $_GET['section_id'];
$db = mysql_connect("localhost", "linwin");
mysql_select_db("linwin", $db);
mysql_query("SET NAMES 'utf8';", $db);
$sql = "SELECT name, description FROM section WHERE id = ". $section_id;
$query=mysql_query($sql, $db);
$section_name = mysql_result($query,0,0);
$section_description = mysql_result($query,0,1);
print "
<table>
<tr><td><form action = \"edit_section_sql.php\"></td></tr>
<tr><td><input type = \"hidden\" name = \"section_id\" value = \"$section_id\"/></td></tr>
<tr><td>Название раздела</td></tr>
<tr><td><input type = \"text\" class = \"text\" size = \"25\" name = \"section_name\" value = \"$section_name\"/></td></tr>
<tr><td>Описание раздела</td></tr>
<tr><td><textarea cols = \"25\" name = \"section_description\" rows = \"4\">$section_description</textarea></td></tr>
<tr><td><input type = \"submit\" name = \"delete_section\" class = \"submit\" value = \"delete\"/>
<input type = \"submit\" name = \"save_section\" class = \"submit\" value = \"save\"/></td></tr>
<tr><td></table></td></tr>
</form>";
include "foot.php";
?>