Jump to content

Iterating Through $_POST variables


Arnsenal

Recommended Posts

Hello Masters

 

I need to iterate through multiple $_POST[''] variables that have been submitted by a form, from the user, checking to see if they have been set or left unfilled.

 

Having a tough time finding a tutorial online...

 

I am a php noob... So I though that I would assign short variable names to the $_POST variables and put them into and array(with names for keys) , then use a for loop and isset() to echo any variable's key in which its value has not been set to the user.

 

I have found out that I can not use variables as array values.... :(

 

What is the best way to do this?

 

Thanks to you in advance sirs.

Link to comment
https://forums.phpfreaks.com/topic/250564-iterating-through-_post-variables/
Share on other sites

I think you should read this post, he had a different problem, but you can find in his code how to validate if a field was left empty in the form (I think that's what you mean)

 

http://www.phpfreaks.com/forums/index.php?topic=347299.0

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.