So, i'm trying to insert usernames from an <input type=text" name="user"> into an array. But it doesn't work.
This works:
This doesn't (text box has the following in it - username1, username2, username3):
I really want to get this to work as it's the last part of my first PHP script.
Ideally i would have the usernames posted into the array via a textarea with each username on a seperate line.
I tried it this way using explode() etc, but i couldn't get it to work. So this is my backup plan.
Any ideas?
This works:
HTML:
$username = array(username1, username2, username3);
foreach ($username as $value) {
etc etc
HTML:
$username = array($_POST['user']);
foreach ($username as $value) {
etc etc
Ideally i would have the usernames posted into the array via a textarea with each username on a seperate line.
I tried it this way using explode() etc, but i couldn't get it to work. So this is my backup plan.
Any ideas?