Hi all, I want to get the value of an html element using its id. I want to do this using php not in javascript(even though i know that php is server side scripting it has nothing to do with client scripting)... Is this possible? If possible means how? Thanks in advance...
Let us try something unconventional.To start with , y do u want this?..anyway you will want to take the HTML to server(or say PHP) first either using conventional POSTing or AJAX or something
No one ( if I haven't misunderstood OPs question ) is talking about the ability to parse HTML but to get input field values entered by the end user, which doesn't exist until the file have been written or data sent somewhere via GET or POST.
I'm agreeing with ActiveFrost and saying it's not possible in PHP due to it being server-side. In Javascript, the scenario is created with: document.getElementById('example'); Code (markup): In PHP, the only way to get the #example id is if it's a form field and "example" is the name attribute. (Retrieved with $_REQUEST['example'])
You answered your own question, due the fact PHP runs on the server before you even see the document and the http protocol stateless, it is impossible to do without JavaScript.
Just what you suggested, AJAX. Sent your content via an asynchronous request in JavaScript to a PHP reviver script, then do what you wish with it.
yep.we are done.now just need to find out the logic for manipulating the script..I mean the HTML.And that was u were looking for?