xyn Posted September 16, 2006 Share Posted September 16, 2006 Hey!I've got a small Private Messaging system, And I wouldlike to allow a larger box so people can send Pms to morethen one member, I wanted it so they ahve to separateeach 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 wouldmean I will have to have more than one text box, it is quiteconfusing...If anyone could help. I would apreciate it.- Thanks!-- Ash Quote Link to comment Share on other sites More sharing options...
shocker-z Posted September 16, 2006 Share Posted September 16, 2006 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}regardsliam Quote Link to comment Share on other sites More sharing options...
xyn Posted September 16, 2006 Author Share Posted September 16, 2006 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 bya comma or one user per line :/ Quote Link to comment Share on other sites More sharing options...
shocker-z Posted September 16, 2006 Share Posted September 16, 2006 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.