bishnu.bhatta Posted June 12, 2009 Share Posted June 12, 2009 Hi, I am new to PHP and got a silly doubt. My friend has designed a form in which there are a lot of hidden and visible fields.When I click submit, the form is posted to some URL.Now that the count of the fields used is more than 20, so I am unable to analyze whats happening. Is there a way to capture all the values from the form before it is posted??? My analysis process should not hamper the usual functionality of the form. Thanks in advance Bishnu Bhatta Quote Link to comment https://forums.phpfreaks.com/topic/161997-help-needed-in-form-method/ Share on other sites More sharing options...
dadamssg Posted June 13, 2009 Share Posted June 13, 2009 what exactly are you trying to do? posting 20 inputs to a url is a touch ridiculous Quote Link to comment https://forums.phpfreaks.com/topic/161997-help-needed-in-form-method/#findComment-854863 Share on other sites More sharing options...
Maq Posted June 13, 2009 Share Posted June 13, 2009 Are these POST or GET values? From what you have said I will speculate GET. Either way, they are contained in arrays in which you can print out (after you submit): print_r($_POST); //and print_r($_GET); Quote Link to comment https://forums.phpfreaks.com/topic/161997-help-needed-in-form-method/#findComment-854887 Share on other sites More sharing options...
bishnu.bhatta Posted June 14, 2009 Author Share Posted June 14, 2009 Maq: Let me put my scenario in a simpler way.... My forum has a login page where users need to sign in. So the form method says: on submit action = abc.php But I want to capture all the login IDs, even the invalid attempts before the submit action. I belive ,I have to do something simlar to this(I don't want this method): 1.Capture the ID using javascript before the submit action 2.pass it to say preprocess.php 3.In preprocess.php, I have to use another method to pass it to abc.php I want to capture and save it in a table before the form passes it to abc.php Hope i was able to explain the scenario properly. Quote Link to comment https://forums.phpfreaks.com/topic/161997-help-needed-in-form-method/#findComment-855490 Share on other sites More sharing options...
Garethp Posted June 14, 2009 Share Posted June 14, 2009 In the <form> command, put onsubmit="Anal(this)" and Anal() should be function Anal(ID) { for (i=0; i<ID.elements.Legnth; i++) { Element = ID.elements[i] alert(Element.name + "=" + Element.value) } } There could be some errors in that JS, it's been a while since I've written something like that Quote Link to comment https://forums.phpfreaks.com/topic/161997-help-needed-in-form-method/#findComment-855491 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.