Thauwa Posted April 3, 2010 Share Posted April 3, 2010 Hello people, I am having trouble trying to do this: I have two forms, form1 and form2, and each has 22 fields. They are to contain some names. How could I check: 1. whether the same name is entered in two or more fields in form1 2. whether a name is repeated once in form1, then in form 2 what my point is that each entry should be unique, how could I do it with php? Just explaining the principles used will be fine, don't bother with any coding! Thanks and Regards, Thauwa P.S. I need the verification to happen online and not in any DB, and I have confused myself with ARRAYS. Thanks for any help you will give me! Quote Link to comment https://forums.phpfreaks.com/topic/197442-how-to-verify-44-fields-at-once/ Share on other sites More sharing options...
monkeytooth Posted April 3, 2010 Share Posted April 3, 2010 i can't remember the exact function names at the moment. But consider on posting the form data saving the inputs in an array within a session. Assuming you go from form 1 to form 2 storing them in a session per form is ideal I would suppose as they will be floating around waiting to be pulled back down and checked. Anyway on posting form1 you build the array to store as a session. Where while building the array you double check to see if theres any doubles. If there is kick back an error or remove them, and do as you want, if not store it in a session for later retrieval. Repeat the concept with form2.. then afterward cross reference array1 and array2 to see if there is any doubles. if there is throw out an error or do what it is you want to do. I know thats rather a crude simplistic explanation of the process I wish I could help you better but I am currently fried myself at the moment. Although you did say give the principals its basic in concept but hope it helps anyway. Quote Link to comment https://forums.phpfreaks.com/topic/197442-how-to-verify-44-fields-at-once/#findComment-1036301 Share on other sites More sharing options...
Thauwa Posted April 3, 2010 Author Share Posted April 3, 2010 Thanks monkeytooth, but I need more clarification as to the "cross-referencing" part. Can anyone give me any in a line or two? Quote Link to comment https://forums.phpfreaks.com/topic/197442-how-to-verify-44-fields-at-once/#findComment-1036361 Share on other sites More sharing options...
ignace Posted April 3, 2010 Share Posted April 3, 2010 form1.php $_SESSION['POST_FORM1'] = $_POST; form2.php $POST_FORM1 = $_SESSION['POST_FORM']; $POST_FORM2 = $_POST; //dig, hit, kick till it's clean Quote Link to comment https://forums.phpfreaks.com/topic/197442-how-to-verify-44-fields-at-once/#findComment-1036365 Share on other sites More sharing options...
Thauwa Posted April 3, 2010 Author Share Posted April 3, 2010 Thanks! Everyone! I am done! Extra information will be appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/197442-how-to-verify-44-fields-at-once/#findComment-1036369 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.