Hi Forum,
Quick question....
Is it it possible to use/send $_POST array as a parameter to function? Meaning I have a function that has as its parameter an array....the values in the array come from $_POST values from a form. Can I just pass in $_POST or do I have to read all the post values into another array?
Regards,
Mike
$_POST Array
Moderator: General Moderators
Re: $_POST Array
I never tried that but I don't see any reason you couldn't pass a $_POST array if you could pass another array. Try it?????????
-
minorDemocritus
- Forum Commoner
- Posts: 96
- Joined: Thu Apr 01, 2010 7:28 pm
- Location: Chicagoland, IL, USA
Re: $_POST Array
It depends on the function. If the function accepts an array as an input, then yes. If not, then no.
Don't get used to trusting the contents of the $_POST array, thought! Keep in mind that user input is not to be trusted.
Don't get used to trusting the contents of the $_POST array, thought! Keep in mind that user input is not to be trusted.
Re: $_POST Array
Like minorDemocritus, make sure you check the input. Maybe have a function accept the input and then immediately send them to their respective purifying functions. This way you can protect your program from exploitationminorDemocritus wrote:It depends on the function. If the function accepts an array as an input, then yes. If not, then no.
Don't get used to trusting the contents of the $_POST array, thought! Keep in mind that user input is not to be trusted.