Follow us on Twitter!
You cannot teach a man anything; you can only help him find it within himself. - Galileo
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 19
Guests Online: 17
Members Online: 2

Registered Members: 82906
Newest Member: ilija
Latest Articles
View Thread

HellBound Hackers | Computer General | General Computer Problems

Author

Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 03:07
how do i make what i get from $_POST into a array?


Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 03:22
Code
$post[0] = $_POST('thing');
$post[1] = $_POST('otherthing');
$post[2] =  $_POST('thingthree';




is that what you mean? that should work...

EDIT: if thats not it try this: http://www.w3scho. . ._array.asp




Edited by on 06-04-07 03:25
Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 03:32
i mean i have a text area, and i have multiple things in it seperated by lines, how do i put each line in its own spot, in the array?


Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 03:40
oic, is this it?
http://www.w3scho. . .y_sort.asp

if not heres a bunch of array functions maybe its one of these
http://www.w3scho. . ._array.asp


Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 03:55
nope that wasnt it either, is there any other way
i can run threw the value of each line?



Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 05:27
The PHP post var is already an array, so unless you're filtering data, and then putting it into another array, there is really no point... Just use $_POST. But, here is my solution :)

Code

$userInput = array();
foreach ($_POST as $key => $value)
{
    $userInput[$key] = $value;
}






If that's not what you're after, could you please explain in more detail what you are trying to achieve?

Good luck,
-Jay.

Edited by on 06-04-07 05:30
Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 05:47
i have a TEXTAREA and the USERNAMES are put on differant lines on the TEXTAREA, and i need to run THREW the USERNAMES and TRY TO LOG IN with them on a differant site


Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 05:55
Then use Regex.
Author

RE: Turning a $_POST into a array

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 06-04-07 10:47
am i missing something?!

$_POST is an array in the first place.

but maybe you want this:

$name = Array(
'firstname' => $_POST['firstname'],
'secondname' => $_POST['secondname']
);




http://www.hellboundhackers.org/
Author

RE: Turning a $_POST into a array


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-04-07 11:41
i have a text area, and i have multiple things in it seperated by lines, how do i put each line in its own spot, in the array

Assuming you had a text area with the name "text" and the contents looked like:

Code
username1
username2
username3
username4




If you wanted to put each of those usernames into an array like a[0]="username1", a[1]="username2" etc then I think darkcoder had what you wanted with:

$a=explode("\n",$_POST["text"]);

but his post got deleted.