|
Posted by Cliff on 09/06/05 05:39
"Hilarion" <hilarion@SPAM.op.SMIECI.pl> wrote in message
news:dfi1pj$o5h$1@news.onet.pl...
> Cliff <clliff@bottomof.com> wrote:
> > Months ago I wrote a script using
> > $fp = fsockopen($host,$port)
> > to open a web page displaying timetable information and then
> > $thisLine = fgets($fp) to read each line of the page
> >
> > $thisLine then contained the html souce code for the page line by line
> > I was thus able to look at the source code for the page
> >
> > Recently the page has changed and I find that now $thisLine no longer
> > contains the source code for the page but rather the text as it is
> > displayed by a browser.
> >
> > Can anyone explain what might have happenned and how I can access the
> > source code like used to?
>
>
> It looks like the server you were getting the file from was not configured
> to interprete the pointed file as PHP, so it passed the contents of the
> file unchanged. Now it does interprete the file as PHP file, so it
> executes the file and returns the output. It means that the server
> configuration changed (it might be server-wide change or folder-wide
> change) or file name extension changed (eg. from .html or .txt to .php).
> In general the server SHOULD interprete PHP files as PHP files and
> execute them, so the behavior you are observing now is natural and
> correct, and the one you got before was wrong.
>
> If you want to get the PHP script source from web server, you should
> use FTP or any other file access protocol, not HTTP.
>
>
> Hilarion
Thanks Hilarion
Obviously I did not make it clear. I do not want to see PHP script source.
The page I get with $fp = fsockopen($host,$port) is in html
(generated by ASP I think)
What I want to get is the same as I see when I "view source" in a browser.
Cliff
[Back to original message]
|