DanDaBeginner Posted March 22, 2007 Share Posted March 22, 2007 for example im going to visit the 'site.com' and im going to right click and view source to see the element name of the form..for example: <form name="form"> <input type="text" name="text1" /> </form> is it possible to automate this in PHP make a system that will read the form element of the site?instead of right click and view source? Quote Link to comment Share on other sites More sharing options...
onlyican Posted March 22, 2007 Share Posted March 22, 2007 Yes its possible. But not easy. You need to open the site in php, which will have the source code. and find <form name= Then Hope they aint like me and do <form method='post' name='XXX' action='' Or some other order. Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 22, 2007 Author Share Posted March 22, 2007 thanx.. can you give some example or turorial in net? Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted March 22, 2007 Share Posted March 22, 2007 http://uk.php.net/curl also look into regular expressions. I'm not sure if there is a beautifulsoup for PHP, maybe? beautifulsoup reads HTML into a tree, then lets you 'find_tag('form')' and stuff like that. monk.e.boy Quote Link to comment Share on other sites More sharing options...
trq Posted March 22, 2007 Share Posted March 22, 2007 You don't need curl for this, a simple call to file_get_contents will get the whole file into a string. From there it would be a matter of parsing out what you need using regex. Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 22, 2007 Author Share Posted March 22, 2007 thanx guys, specially to you thorpe .. but im having a fatal error because im accessing the https://... what can I do? is it mean that im not getting all the contents of the page? Warning: file() [function.file]: SSL: fatal protocol error in C:\Program Files\xampp\htdocs\wala.php on line 4 Quote Link to comment Share on other sites More sharing options...
trq Posted March 22, 2007 Share Posted March 22, 2007 What version of php are you using? https is only available > 4.3.0 Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 22, 2007 Author Share Posted March 22, 2007 im using php5.. and also in the page when I view source it: name="U2FsdGVkX18bwx3F3BCfCpyja8tQA3tRqKboSwS9MFlZeLLxQgfok0GxEwG2cEW3wVg9zegsG7p6EoaogdqPNg" -------------------- while in my script: name="U2FsdGVkX19uYT7U8YEg2DCV_whbmDNN6R4B0IJfonthq_3wxm1DrViNSnV3yAaAcO89FddMoBW7EDpiO9ng_A" ______________________ why they having differences? it should be the same.. Quote Link to comment Share on other sites More sharing options...
trq Posted March 22, 2007 Share Posted March 22, 2007 That looks like some randomly generated stuff, probably changes with each request. Does this mean your issue with https is fixed? Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 22, 2007 Author Share Posted March 22, 2007 no, the fatal error is still displaying... Quote Link to comment Share on other sites More sharing options...
trq Posted March 22, 2007 Share Posted March 22, 2007 Read the warning here. Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 22, 2007 Author Share Posted March 22, 2007 ohh! thanks.. so no difference between the http and https its just all about warning.. right? Quote Link to comment 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.