ryanteck Posted December 4, 2009 Share Posted December 4, 2009 well im stuck a little bit im trying to create a script wich is able to grab a var and use it to get a bit of code from another site eg var=Sojobo-taro submit will then Find In Page habborp.com/home/?name=var find: <img alt="Var" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=hr-802-45.hd-190-1.ch-886-100.lg-285-110.sh-906-110.ea-1404-110.fa-1201-.wa-2009-110&size=b&direction=4&head_direction=4&gesture=sm l" /> Then I Need It TO Copy figure=hr-802-45.hd-190-1.ch-...=4&gesture=sml And Place It In The Code Thanks A Lot Ryanteck Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/ Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 u can use this code <?php $url_feed='http://google.com'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); $output = curl_exec($ch); $fh = fopen("out.txt", 'w'); fwrite($fh, $output); $value='<img alt="Var" src='; $section = file_get_contents('./out.txt', NULL, NULL, 1256, 95); /*echo $section; $fh1=fopen("out_1.txt",'w'); fwrite($fh1, $section); fclose($fh1); var_dump($section);*/ fclose($fh); curl_close($ch); ?> but after this u need to scan the entire txt file for these characters and display the result.. or else it it comes at a particular place u can use it of directly Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971190 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 so will it automaticly find that text for me? Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971194 Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 what i am basically doing out here is if it is giving the value at the resultant location then it is okay or else it will give false. it will not automatically scan the document(txt file)i am working on that option. Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971196 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 ok then il just wait Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971198 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 the line is always the same so could it work like that? il try using your script Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971222 Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 if the location of the text doesnot change then u can use it with out difficulties.. Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971225 Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 one more thing $section = file_get_contents('./out.txt', NULL, NULL, 1256, 95); change the numbers to the required ones Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971226 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 the line number changes but it is always after the text <div class="profile-setting"> Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971235 Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 then i hope u cannot use the below code Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971247 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 then any help? Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971257 Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 i am working on that will post the code here once i resolve it out Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971258 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 done yet? Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971278 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 Bump NEed Help! Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971303 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 well im stuck a little bit im trying to create a script wich is able to grab a var and use it to get a bit of code from another site eg var=Sojobo-taro submit will then Find In Page habborp.com/home/?name=var find: <img alt="Var" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=hr-802-45.hd-190-1.ch-886-100.lg-285-110.sh-906-110.ea-1404-110.fa-1201-.wa-2009-110&size=b&direction=4&head_direction=4&gesture=sm l" /> Then I Need It TO Copy figure=hr-802-45.hd-190-1.ch-...=4&gesture=sml And Place It In The Code Thanks A Lot Ryanteck Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971318 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 HELP! :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971342 Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 <?php $user = 'Sojobo-Taro'; $html = file_get_contents('http://habborp.com/home/?name='.$user); $doc = new DOMDocument(); @$doc->loadHTML($html); $xpath = new DOMXPath($doc); $results = $xpath->query("//div[@class='profile-figure']/img"); if (!is_null($results)) { foreach ($results as $result) { echo $result->getAttribute('src'); } } ?> will get the link now i need to code it into <?php if(isset($_POST['imager'])) { $name = $_POST['name']; $action = $_POST['action']; $direction = $_POST['direction']; $h_direction = $_POST['h_direction']; $gesture = $_POST['gesture']; $size = $_POST['size']; echo("<p align=\"center\">Your result..</p><p align=\"center\"><img src=\"(Where The Figure Id Goes)" . $name . "&action=" . $action . "&direction=" . $direction . "&head_direction=" . $h_direction . "&gesture=" . $gesture . "&size=" . $size . "\" alt=\"This habbo does not exist\" /></p>"); please help! Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971365 Share on other sites More sharing options...
Deoctor Posted December 7, 2009 Share Posted December 7, 2009 hai i found a resolution for my problem.. hope this might help you out.. <?php $url_feed='http://google.com'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); $output = curl_exec($ch); $fh = fopen("out.txt", 'w'); fwrite($fh, $output); $value1='Congratulations!'; $value='img alt="[Valid RSS]" title="Valid RSS" src="images/valid-rss.png" /> This is a valid RSS feed.'; $file=file_get_contents("out.txt"); //echo $file; $result=stristr($file,$value1); $fh1 = fopen("out1.txt", 'w'); fwrite($fh1,$result); $section = file_get_contents('./out1.txt', NULL, NULL, 39, 95); //echo $section; if($section==$value) { echo "Success"; } else { echo "The test case Failed"; } fclose($fh); fclose($fh1); curl_close($ch); ?> so here actually wht i am doing is that i am cutting the things that would be published above a particular keyword. and storing it in the out1.txt.. this would give the resultant things in which i need to check and i am scan only these for the validation.. Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-972695 Share on other sites More sharing options...
plznty Posted December 7, 2009 Share Posted December 7, 2009 You could use preq_match. What are you trying to achieve? I see your doing something using otakus habbo servers. Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-972698 Share on other sites More sharing options...
Deoctor Posted December 7, 2009 Share Posted December 7, 2009 dude i got tired of telling the same to everyone.. i used the preg function and the damn thing is not working for me.. so i am using the curl function. i wrote this to find out whether the given url is a valid Rss feed or not.. if u can give me a better solution that would be greatly appreciated.. i have used this function to check that !@$xml=simplexml_load_file("$subscr") after which i have tried the preg..and the funny thing is that preg will not work here as the urls for these feeds will not have common things for different sites Link to comment https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-972700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.