これは状況です:
外部 ASP ページで何か (ニックネーム) が生成されたことを確認する PhP ログイン ページがあります。
例: 私はログインしていますか? そのため、ASP ページを直接開くと、「nickname:thecrius」のみが表示されます。ログインしていませんか?したがって、ASP ページを開いても何も表示されません。
ここで、PhP ページで「thecrius」文字列をキャッチする必要があります。file_get_contents を使用すると、asp ページの「静的」部分である「nickname:」のみが返されます。
私が間違っているのは何ですか?
いくつかのコード:
$aspSource = "http://www.example.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";
ただ、結果は
URL-> http://www.example.com/inc/whois.asp
Content-> username:
Start-> 9
Username->
END
助けてくれる人に前もって感謝します!