How to get the dynamic generated content of an external ASP file using PhP?

Posted by theCrius on Stack Overflow See other posts from Stack Overflow or by theCrius
Published on 2010-05-03T11:24:48Z Indexed on 2010/05/03 11:28 UTC
Read the original article Hit count: 218

Filed under:
|
|

This is the situation:

I've a PhP login page that check is an external ASP page has generated something (nickname).

For example: i'm logged? So opening directly the asp page will display "nickname:thecrius" and nothing more. I'm not logged? So opening the ASP page will display nothing.

Now i've to catch the "thecrius" string with a PhP page. Using file_get_contents only return me "nickname:", the "static" part of the asp page.

What i'm doing wrong?

Some codes:

$aspSource = "http://www.domain.com/inc/whois.asp"; //ASP external
$file = file_get_contents($aspSource); //get content of the asp page
$start = strpos($file, "username:") + 9; //cutting off the "nickname:"
$username = substr($file, $start); //get the username
echo "URL-> $aspSource<br>Content-> $file<br>Start-> $start<br>Username-> $username<br>END";

But the result is only

URL-> http://www.domain.com/inc/whois.asp
Content-> username:
Start-> 9
Username->
END

Thanks in advance to anyone will help!

© Stack Overflow or respective owner

Related posts about php

Related posts about asp