xyn Posted December 4, 2006 Share Posted December 4, 2006 Hey guys.I've got a small problem, Like phpBB, When a user checksa multiple / one amount of messages, from their Privatemessenger, I want them to be able to do the following.- Delete- Mark as Read- Mark as Unseen- MoveHow ever i can do this by 4 submit buttons, and the ifstatements, works fine, but within the IF i get this error:Warning: join() [function.join]: Bad arguments. in /home/jetex/public_html/inc/functions.php on line 634My code is... [[color=red]NOTE: I know the die("$list"); will stop the script, i wamnted to see the list of ID's[/color]][code=php:0]function pmaction(){if(isset( $_POST[delete] )){ if(empty($_POST[del])) { echo ("<p class=\"text\"><span class=\"error\">Error:</span><br>Please select your message(s) which you want to delete.</p>"); return false; } $list = join(',', $_POST[del]); die("$list"); mysql_query("DELETE FROM pm WHERE id IN ($list)"); header("location: ./index.php?dir=member&page=inbox");}elseif(isset( $_POST[markold] )){ if(empty($_POST[del])) { echo ("<p class=\"text\"><span class=\"error\">Error:</span><br>Please select your message(s) which you would like to mark as seen.</p>"); return false; } $list = join(',', $_POST[del]); die("$list"); mysql_query("UPDATE pm SET stats='seen' WHERE id IN ($list)"); header("location: ./index.php?dir=member&page=inbox");}elseif(isset( $_POST[marknew] )){ if(empty($_POST[del])) { echo ("<p class=\"text\"><span class=\"error\">Error:</span><br>Please select your message(s) which you would like to mark as not seen.</p>"); return false; } $list = join(',', $_POST[del]); die("$list"); mysql_query("UPDATE pm SET stats='unseen' WHERE id IN ($list)"); header("location: ./index.php?dir=member&page=inbox");}elseif(isset( $_POST[move] )){ if(!isset( $_POST[movedir] )) { echo ('page_down'); //include("./member/move_file.php"); } else { if(empty( $_POST['list'] )) { echo ("<p class=\"text\"><span class=\"error\">Error:</span><br>Please select your message(s) which you would like to move to another folder.</p>"); return false; } die("$list"); mysql_query("UPDATE pm SET folder='".MakeSafe($_POST[folder])."' WHERE id IN ($list)"); header("location: ./index.php?dir=member&page=inbox"); }}return true;}?>[/code] Link to comment https://forums.phpfreaks.com/topic/29456-warning-join-functionjoin-bad-arguments/ Share on other sites More sharing options...
fert Posted December 4, 2006 Share Posted December 4, 2006 well first of all:[code]header("location: ./index.php?dir=member&page=inbox");[/code]is a no-noand remove the () from echo because echo isn't a function and try using implode instead of join. Link to comment https://forums.phpfreaks.com/topic/29456-warning-join-functionjoin-bad-arguments/#findComment-135162 Share on other sites More sharing options...
xyn Posted December 4, 2006 Author Share Posted December 4, 2006 Why is the below; a no-no?header("location: ./index.php?dir=member&page=inbox"); Link to comment https://forums.phpfreaks.com/topic/29456-warning-join-functionjoin-bad-arguments/#findComment-135180 Share on other sites More sharing options...
fert Posted December 4, 2006 Share Posted December 4, 2006 because you output things to the browser above it Link to comment https://forums.phpfreaks.com/topic/29456-warning-join-functionjoin-bad-arguments/#findComment-135187 Share on other sites More sharing options...
xyn Posted December 6, 2006 Author Share Posted December 6, 2006 But, it's so it delets the message, and instantly directs. Link to comment https://forums.phpfreaks.com/topic/29456-warning-join-functionjoin-bad-arguments/#findComment-136362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.