views:

30

answers:

1

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!

A: 

I guess you are logged in the site with your browser, but you aren't logged with the PHP script.

Lo'oris