Jump to content

Get HTML from External Page


phoenixx

Recommended Posts

I know this is easy but I'm getting an error.  I'm scraping an external page of one of my other sites and using the following code w/ the following error:

 

<?php

$data = fopen("http://post.XXXXXXX.org/XXXXX/XXX/x/", "r");  ;

preg_match_all('/<input.*?name="([^"]*)".*?value="([^"]*)"/is',$data,$out);

$d = array_combine($out[1], $out[2]);

print_r($d);

?>

 

Error:

 

Warning: preg_match_all() expects parameter 2 to be string, resource given in /home/XXXX/public_html/sandbox/post1.php on line 3

 

Warning: array_combine() expects parameter 1 to be array, null given in /home/kennyaar/public_html/sandbox/post1.php on line 4

 

Link to comment
https://forums.phpfreaks.com/topic/117900-get-html-from-external-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.