<php
if (!$_POST['updateoptions']) { ?>
<form method="post">
<select name="options">
<option>Options</option>
<?php
$id=$_GET['id'];
$query=mysql_fetch_array(mysql_query("SELECT * FROM `thread` WHERE id='$id'"));
if ($query[sticky] == 0) {
echo '
<option value="1">Make Topic Important</option>';
} elseif ($query[sticky] == 1) {
echo '
<option value="0">Make Topic Unimportant</option>';
}
if ($query[locked] == 0) {
echo '
<option value="1">Lock Topic</option>';
} elseif ($query[locked] == 1) {
echo '
<option value="0">Unlock Topic</option>';
}
echo '
</select>
<input type="submit" name="updateoptions" value="Go">
</form>';
} else {
$id=$_GET['id'];
$options = $_POST['options'];
$update=mysql_query("UPDATE thread SET sticky = $options WHERE id='$id'");
echo '<meta http-equiv="Refresh" content="0; URL=view_topic.php?id='.$id.'">';
}
?>
so the way i have it is if the topic is stickyed, it shows the option to unsticky it, and visa versa. Same for if the topic is locked, but it works fine for updating the sticky, and if i add locked = $options both sticky and locked changes to the same thing. how can i get it so it only effects what is selected. i cant figure it out :wacko:
Edited by venomsnake, 13 March 2006 - 09:49 AM.
