Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.