Re: HTTP POST into PHP

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Alex Dean
Date:  
To: plug-discuss
Subject: Re: HTTP POST into PHP
Don Calfa wrote:

> Alex Dean wrote:
>
>> I do almost the same as this...
>> echo "<pre>";
>> var_dump($_POST);
>> echo "</pre>";
>> die(); // good to have this if you're debugging a script which could
>> 'do stuff' like update a database.
>>
>> var_dump() gives you a little more meta-information about a variable
>> than print_r() does, but they're basically equivalent for the current
>> purpose.
>>
>> alex
>> ---------------------------------------------------
>>
> Just curious, why do you kill your script after the results?


Saftey precaution. If I'm ever dumping the entire $_POST, it's usually
because I'm not 100% sure what's going to be there. If I'm not sure
what kind of data I'm getting, I don't want to use it for anything
meaningful.

The script could potentially update a database or modify files using the
submitted data. I don't want to allow that until I'm confident I know
what will be in the POST, and I've put validations and such in place to
deal with bad data.

alex
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss