Jump to content

[SOLVED] PHP cURL of an ASP page


fanfavorite

Recommended Posts

Ok, I am trying to use cURL to read from an ASP page.  I wanted to use file_get_contents, however the server blocks it.  When I use cURL and echo the results, I get the error:

 

Microsoft JScript runtime error '800a138f'

'length' is null or not an object

/CommonFunctions.asp

 

The code is:

 

$URL1 = "http://www.somewebsite.com/somefile.asp";
$ch = curl_init();  
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
curl_setopt($ch, CURLOPT_URL,$URL1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); 

$buffer = curl_exec($ch);
echo $buffer;
curl_close ($ch); 

 

Any ideas on how to get around this?  The code just stops at this error. Thanks. 

 

Link to comment
https://forums.phpfreaks.com/topic/116613-solved-php-curl-of-an-asp-page/
Share on other sites

Heres a live example of problems reading asp pages:

 

<?

$URL1 = "http://www.w3schools.com/asp/default.asp";

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 

curl_setopt($ch, CURLOPT_URL,$URL1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);

$buffer = curl_exec($ch);

echo $buffer;

curl_close ($ch);

?>

 

It stops at the <body> tag. 

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.