kevinkhan Posted June 2, 2010 Share Posted June 2, 2010 Can somebody explain what these few lines mean?? $logInPage = file_get_html('https://login.facebook.com/login.php'); $qryString = ''; foreach($logInPage->find('form input[type=hidden]') as $hidden) { echo $hidden."<br />"; // $qryString = $qryString.'&'.$hidden->name.'='.urlencode($hidden->value); // echo $qryString."<br />"; } Link to comment https://forums.phpfreaks.com/topic/203631-simple-html-dom-question/ Share on other sites More sharing options...
lostnucleus Posted June 2, 2010 Share Posted June 2, 2010 file_get_html() ; takes input argument url , it then loads the webpage identified by this url , as document object model and returns it , using find method it searches for hidden elements and return the result as an array of all the hidden elements found in the loaded dom , then you simply treat that as an array to iterate each single dom element (hidden) , the output will be <input type="hidden" name="session" value="4343"/><input type="hidden" name="boi" value="4343fdf"/><input type="hidden" name="dfdf" value="4df343df"/> Link to comment https://forums.phpfreaks.com/topic/203631-simple-html-dom-question/#findComment-1066664 Share on other sites More sharing options...
kevinkhan Posted June 2, 2010 Author Share Posted June 2, 2010 what would this one mean? foreach($html->find('div.article') as $article) Link to comment https://forums.phpfreaks.com/topic/203631-simple-html-dom-question/#findComment-1066705 Share on other sites More sharing options...
kevinkhan Posted June 2, 2010 Author Share Posted June 2, 2010 how do i get the first paragraph in a div with an id of main_content_content? i have this so far foreach($html->find('div[id=main_content_content] p', 0) as $par) but doesnt work Link to comment https://forums.phpfreaks.com/topic/203631-simple-html-dom-question/#findComment-1066722 Share on other sites More sharing options...
lostnucleus Posted June 2, 2010 Share Posted June 2, 2010 how do i get the first paragraph in a div with an id of main_content_content? i have this so far foreach($html->find('div[id=main_content_content] p', 0) as $par) but doesnt work try this $pTagElement = $html->find('div[id=main_content_content] p')->current(); Link to comment https://forums.phpfreaks.com/topic/203631-simple-html-dom-question/#findComment-1066732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.