Retrieve the input text from HTML after parsing
I am new to PHP and DOMDocument, I have couple of doubts
1)
..
<input type ="text" name ='name'>
..
<input type = "text" name='password'>
Later, At the server I would like to parse this php document before i开发者_开发知识库t is interpreted. I would like to know what the user has inserted, edit it in the format I want and then send it to PHP interpreter. I want to get all text inserted in all the input tags in a particular document. Is this possible?
edit: After clicking the send button say he typed name as "XYZ", and password as "ABC". I want my program to grab these 2 texts and edit it. Like i want my program to add this text "123" to end of all the strings that come from input tag so my name = "XYZ123" and password is "ABC123". Now this text should be sent to server for further processing.
2) If I want to do this process each time this page is sent to server and extend it for all pages, how should I go about it? Where should I place this program that scans edit and later sends it for interpretation?
If the user has submitted the form, then the data will be in $_GET or $_POST (depending on the method used to submit the form, $_REQUEST will contain both, along with user data from other sources).
If they haven't submitted the form, then you won't normally be sent the data. You could use JavaScript to send the data to the server as the user enters it (think Google instant).
精彩评论