Hi there, I want a tool that gets the values (elements) of a form. Can anyone please provide me that kind of utility. I will be really thankful. Best Regards KB
Yeah, what he said. Form: <form method = 'post' action = 'example.php'> <input type = 'text' name = 'name'> <input type = 'text' name = 'email'> <input type = 'submit' value = 'Submit'> </form> Code (markup): Display values: foreach($_POST as $value) { echo $value . "<br />"; } PHP: Something like that.
sounds to me like you need $_POST or $_GET here's the man pages us2.php.net/manual/en/reserved.variables.php#reserved.variables.post us2.php.net/manual/en/reserved.variables.php#reserved.variables.get here's an example of looping through the $_POST / $_GET vars submitted by a page: <?php if ($_POST) { foreach ($_POST as $key => $value) { echo "NAME: ".$key.", VALUE: ".$value."<br />"; } } else { echo "no $_POST vars found. checking $_GET...<br /><br />"; if($_GET) { foreach ($_GET as $key => $value) { echo "NAME: ".$key.", VALUE: ".$value."<br />"; } } else { echo "no $_GET vars found."; } } ?> Code (markup):
Hi there, Actually I am working on a web based application for submitting the websites in the web directories. Web directories contain forms and I want to get the values of these forms with the help of a tool. If I have 1000 web directories then it will not be possible for me to manually get the values from each form. So I immediately require a tool to get the field values of the forms. I will really appreciate any help. Best Regards KB
well it could be done with some regexp and scraping the pages but it's not something that i want to write for you...
As ansi said, you can either use a purely serverside solution using regexp or else you can use both serverside and clientside. All I can give is a rough idea * Get the content of the page using serverside, insert the required javascript into it and echo it. * The javascript will collect info about the required fields and send you the details using an ajax request. * Then the page gets redirected to the next page to get the content of the new page.
sounds like his best bet to me. i like the part about using javascript to get the values of the form fields. there could be millions of patterns to match all the sites that he requests but with javascript gathering all the values and stuff, it would be a breeze.
It wouldn't hurt to grab a full list of the $_POST and $_GET variables and store them and you can just have a script sift through them and put things together like $_POST['name'] and $_POST['fullname'] are the same, etc.
I think you got the idea wrong. What he want is to get the available form fields and types in another page.
Ah gotcha, been up all night, a little out of it Regular expressions might not be a bad idea in that case.