Minase Posted June 28, 2008 Share Posted June 28, 2008 hy there i do have the following code echo ' <tr><td align="center" class="tdn" colspan=3><select class=input name="wn" size=1><option value="b">tagged messages<option value="a">all messages<option value="c">untagged messages</select> <select name="to" size=1 class=input> <option value="l">delete</select> <input type=submit name="do" class=input value="Go!"></th></tr> '; if (isset($_POST['wn'])) if ($_POST['wn'] == 'a') { mysql_query("DELETE FROM `" . DBPREFIX . "users_messages` WHERE ReciverID = " . $_SESSION['user_id']) OR DIE(mysql_error()); } elseif ($_POST['wn'] == 'b') { foreach($_POST as $a => $b){ if(preg_match("/x/",$a) && $b == 'on'){ $id = str_replace("x","",$a); $note_query = mysql_query("SELECT * FROM `" . DBPREFIX . "users_messages` WHERE UID='".$id."' AND ID='".$_SESSION['user_id']."' "); if($note_query){ $deleted++; mysql_query("DELETE FROM `" . DBPREFIX . "users` WHERE UID='".$id."'"); } } } } i was wondering what i did wrong,cause whatever i select it doesnt do anything. if i select to delete everything (the query is good) but it doesnt delete.. thank you Link to comment https://forums.phpfreaks.com/topic/112368-solved-php-and-post/ Share on other sites More sharing options...
irvieto Posted June 28, 2008 Share Posted June 28, 2008 Hi. First of all, use proper html tags. <option value="some_val">Some text</option>. Then, check your $_POST to see what is the information you are receiving.. print_r($_POST); Link to comment https://forums.phpfreaks.com/topic/112368-solved-php-and-post/#findComment-576917 Share on other sites More sharing options...
thatsgreat2345 Posted June 28, 2008 Share Posted June 28, 2008 Just to let you know you do not need to use echo to echo out HTML code. You can close the opening php tag, and then reopen a new one where you need it. so instead of echo replace it with , this is assuming that there is PHP above this HTML code. ?> <tr><td align="center" class="tdn" colspan=3> <select class=input name="wn" size=1> <option value="b">tagged messages</option> <option value="a">all messages</option> <option value="c">untagged messages</option> </select> <select name="to" size=1 class=input> <option value="l">delete</option> </select> <input type=submit name="do" class=input value="Go!"></th></tr> <? Link to comment https://forums.phpfreaks.com/topic/112368-solved-php-and-post/#findComment-576921 Share on other sites More sharing options...
Minase Posted June 28, 2008 Author Share Posted June 28, 2008 thanks for help Link to comment https://forums.phpfreaks.com/topic/112368-solved-php-and-post/#findComment-576924 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.