Arnsenal Posted November 6, 2011 Share Posted November 6, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/250564-iterating-through-_post-variables/ Share on other sites More sharing options...
Pikachu2000 Posted November 6, 2011 Share Posted November 6, 2011 What do you mean you "can not use variables as array values"? Quote Link to comment https://forums.phpfreaks.com/topic/250564-iterating-through-_post-variables/#findComment-1285557 Share on other sites More sharing options...
Gotharious Posted November 6, 2011 Share Posted November 6, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/250564-iterating-through-_post-variables/#findComment-1285560 Share on other sites More sharing options...
Arnsenal Posted November 6, 2011 Author Share Posted November 6, 2011 Thanks Guys Gotharious Im looking through his code now. Good stuff. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/250564-iterating-through-_post-variables/#findComment-1285569 Share on other sites More sharing options...
Gotharious Posted November 6, 2011 Share Posted November 6, 2011 Oh, and please mark this thread as solved once you solve your problem Quote Link to comment https://forums.phpfreaks.com/topic/250564-iterating-through-_post-variables/#findComment-1285571 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.