pocobueno1388 Posted December 4, 2006 Share Posted December 4, 2006 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]<?phpif ($_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 timeAny 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 More sharing options...
keeB Posted December 4, 2006 Share Posted December 4, 2006 add an else and print out a debug line like "hi" see if that is really what's happening. Link to comment https://forums.phpfreaks.com/topic/29365-script-ignoring-an-if-statement-solved/#findComment-134664 Share on other sites More sharing options...
pocobueno1388 Posted December 4, 2006 Author Share Posted December 4, 2006 I just did that and nothing happened =/ Link to comment https://forums.phpfreaks.com/topic/29365-script-ignoring-an-if-statement-solved/#findComment-134670 Share on other sites More sharing options...
pocobueno1388 Posted December 4, 2006 Author Share Posted December 4, 2006 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. Link to comment https://forums.phpfreaks.com/topic/29365-script-ignoring-an-if-statement-solved/#findComment-134674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.