Jump to content

Warning: join() [function.join]: Bad arguments


xyn

Recommended Posts

Hey guys.
I've got a small problem, Like phpBB, When a user checks
a multiple / one amount of messages, from their Private
messenger, I want them to be able to do the following.

- Delete
- Mark as Read
- Mark as Unseen
- Move

How ever i can do this by 4 submit buttons, and the if
statements, 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 634

My 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

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.