Jump to content

Script ignoring an IF statement. *SOLVED*


pocobueno1388

Recommended Posts

I have a forum script and I am making it so moderators are able to move topics to different boards. I have already made plenty of features like this throughout the script, but for some reason it seems like the IF statement is being ignored.

Here is the part of the script that is not working:
[code]
<?php

if ($_POST['move_board']){

$topic_move = $_GET['topic_move'];

$new_board = $_POST['new_board'];

echo "<table class='main'><td class='main' align='center'>Successfully moved topic.</td></table>";

mysql_query("UPDATE forum SET category='$new_board' WHERE topicID='$topic_move'");

}

print <<<HERE
<form action="boards.php?topic_move=$topic" method="post">

Move: <select name="new_board">
<option value="general">General</option>
<option value="advertise">Advertise</option>
<option value="buying">Buying/Selling</option>
<option value="creativity">Creativity Board</option>
<option value="contests">Contests</option>
<option value="bugs">Bugs</option>
<option value="breed">Breed Suggestions</option>
<option value="othergames">Other Games</option>
<option value="help">Help</option>
<option value="suggestions">Suggestions</option>
</select>

<input type="submit" name="move_board" value="Move">(not working yet)

</form>

?>

HERE;

?>
[/code]

What is happening is when I click on the submit button named 'move_board' it takes me to where the form action is set, but nothing happens. It's like it totaly ignores the IF statement above. As I said before, I have used this method many times and I have no idea why it decided not to work this time

Any help is greatly appreciated. Thanks =D
Link to comment
https://forums.phpfreaks.com/topic/29365-script-ignoring-an-if-statement-solved/
Share on other sites

Ugh, sorry for putting you guys through the trouble. I made a stupid mistake. I had the form action sending to a different page while the IF was on the same page as the script I was working with. So it's all working now.

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.