<?php
if(isset($_POST["save_category"])) {
// this is our variables being submitted
$title = htmlspecialchars($_POST["title"]);
$description = htmlspecialchars($_POST["description"]);
$date_added = date("F j, Y");
$id = $_POST["id"];
$etable = "Edited category from the Gallery";
$result = mysql_query("UPDATE `admin_details` SET lastedit = '$etable' WHERE username='$username'");
$result = "UPDATE `gallery_categorys` SET title = '$title', description = '$description' WHERE id = '$id'";
mysql_query($result)or die(mysql_error());
// success, settings updated, now to redirect or echo something.
echo "<meta http-equiv=\"refresh\" content=\"3 url=$domain/admin/index.php\">";
echo " <h1>Category Successfully Edited</h1>
<p>Your gallery category have been successfully edited, and you are now being redirected back to the administrative home.</p>
";
} else {
?>
<a name="editcategory"></a>
<h1>Edit Category</h1>
<p>Feel free to edit a gallery category. You can do so below using the form below.</p>
<table width="100%" border="0" cellpadding="0" cellspacing="3" align="left">
<!--- settings start -->
<tr>
<td width="45%"><strong>» Select Category</strong></td>
<td width="50%">
<form>
<select name="photos" onchange="showGalleryCategorys(this.value)" style="margin: 0px; width: 95%; padding: 3px; border: 1px solid #e6e6e6;" />
<option value="">---- Select an Category ----</option>
<?php
$query = mysql_query("SELECT * FROM `gallery_categorys` ORDER BY position ASC");
ifempty($query);
while($r = mysql_fetch_array($query)){
$id = $r["id"];
$title = $r["title"];
echo " <option value =\"$id\">$title</option>
";
}
?>
</select>
</form></p>
</td>
</tr>
<!--- settings end -->
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="3" align="left">
<form name="pform" method="post" action="<?=$domain;?>/admin/index.php?go=pages/gallery&do=edit_category">
<!--- settings start -->
<div id="txtHint"></div>
<!--- settings end -->
</form>
</table></p>
<?php
}
?>
Now I have it load forms to edit in txtHint area through edit_category_2 using javascript & the dropdown.
But when I go to submit it and save it, it dosn't submit, it dosnt do anything.
Any ideas people?
Edited by Braunson, 07 September 2007 - 07:59 AM.
