Jump to content

Archived

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

xyn

Multiple-PMS

Recommended Posts

Hey!
I've got a small Private Messaging system, And I would
like to allow a larger box so people can send Pms to more
then one member, I wanted it so they ahve to separate
each member by a ','.

I have the basic idea on how to do it following my "array"
which is used to delete PM's with tick boxes, but that would
mean I will have to have more than one text box, it is quite
confusing...

If anyone could help. I would apreciate it.
- Thanks!
-- Ash

Share this post


Link to post
Share on other sites
well you would use somthing like

$users=explode(', ',$_POST['users']);
foreach($users as $user) {
//code here and each user will be in the variable $user
}


regards
liam

Share this post


Link to post
Share on other sites
that means i would need more than 1 text box with the name "users[]"
I wanted one textarea which allows them to separate each user by
a comma or one user per line :/

Share this post


Link to post
Share on other sites
yeah that's what that does because it explodes you normal box e.g. named users and then it explodes by ', ' so a comma and a space and creates an array called $users so in users we now have all the users with no comma and then the foreach $users as $user will rip each user out of the array and run what ever command u wish on them.

put the code working here [url=http://www.ukchat.ws/phpfreaks/users.php]http://www.ukchat.ws/phpfreaks/users.php[/url]

so e.g. code

[code]<form action="" method="post">
Users: <input type="text" name="users">
<input type="submit" name="submit" value="submit">
</form>
<?php
$users=explode(', ',$_POST['users']);
foreach($users as $user) {
echo $user.'<Br>';
}

?>[/code]


Liam

Share this post


Link to post
Share on other sites

×

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.