for each loops question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

for each loops question

Post by Charles256 »

Code: Select all

foreach ($_POST as $key=>$value)
and then use variable variables to produce the error variables to be echoed and this page is only called if a certian condition is met which includes the page. so how come everyone doesn't do that? any good reasons? Just curious, this might need to be in the security thread? Not entirely sure but feel free to move me if need be.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Charles256 wrote:so how come everyone doesn't do that? any good reasons?
well... different people handle inputs in different ways. Normally, I leave all input data in an array and use a queue-style list to store up any errors, gracefully degrading where possible. It requires a lot of code, but makes the user's life a lot easier when they don't have to remember very specific formats to add data to this or that type..
Charles256 wrote:Just curious, this might need to be in the security thread?
It could be, but I'm willing to let it slide... ;)
Charles256 wrote:Not entirely sure but feel free to move me if need be.
we feel free to move a thread, whether the poster likes it or not :P
Post Reply