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? Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/ 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. Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212674 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? Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212676 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 Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212687 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. Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212707 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 Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212712 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 Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212718 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.. Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212721 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? Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212723 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... Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212732 Share on other sites More sharing options...
trq Posted March 22, 2007 Share Posted March 22, 2007 Read the warning here. Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212735 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? Link to comment https://forums.phpfreaks.com/topic/43807-solved-is-this-possible/#findComment-212738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.