PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /nfs/c02/h10/mnt/30579/domains/forum-racunara.com/html/test/taggrab.php on line 64
Warning: file_get_contents(http://www.google.co.uk/search?q=test) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /nfs/c02/h10/mnt/30579/domains/forum-racunara.com/html/test/taggrab.php on line 64
Its a problem with file_get_contents. If you look in the source code i've commented out your CURL lines and added my own file_get_contents. Delete my line and uncomment your CURL lines and it should work.
Not sure what you mean, definately looks like a list of links to me. As i said, there are some false positives which you may want to filter out, but thats returning pretty much everything that could be a link.
From what i can see its now doing what you wanted your original code to do?
The_L wrote:Okay now that that is done,how can i filter it to search and export just like rapidshare links...
two ways - loop through with a simple string match, or loop through and apply a regex. there are other ways but these are easiest. An example of a simple string match, assuming all of the links are stored in $linkarray:
You could do it as part of the loop thats outputting the display. Instead of creating a new array and copying the links to it, you could run the if statement in your existing loop and only output if it matches, e.g.
The code you've added at the top should be fine (if a little odd, probably better to use an if statement and exit to stop the script - on some servers, die() goes to error log instead of output)
The second bit does look right, but to test it try commenting out the if lines (i.e. 9 and 11 in the last bit of code you posted). Check the results you get to make sure its finding some matching rapidshare.com and we'll go from there. Its possible that either the page you're getting doesn't contain rapidshare links, the regex isn't working quite right, or the strpos bit isn't working, so temporarily disabling the lines above will hopefully narrow it down!
Fatal error: Call to a member function parse_array() on a non-object in /nfs/c02/h10/mnt/30579/domains/forum-racunara.com/html/test/taggrab.php on line 19
echo "<h2>Links present on page: ".$urlrun."</h2><br />";
// Loop to pump out the results
echo "<ul>";
$search = '.rapidshare.com/'; // matches *.rapidshare.com/
foreach ($linkarray as $links) {
foreach($links as $link) {
// if(strpos($link, $search) > -1) {
echo "<li>$link<li>";
// }
}
}
echo "</ul>";
everything else should stay as it was that simply disables the actual string checking so you can manually check the results to make sure they definately include rapidshare URLs