RE: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Rasmus Lerdorf

> > > If readfile is indeed that "broken", maybe we can talk the
> > > powers that be into dumping full HTTP headers through the
> > > readfile call in a future version I mean, the main
> > > script has it already from when it was called... so it
> > > should be able to sub-call pages in that same context.
> >
> > readfile() is not broken at all.
>
> "broken" was in quotes for a reason... yes, it works the way the docs say -
> but it doesnt work well enough in light of the fact that virtual gives me
> garbage.

Well, shouldn't you be complaining about virtual() then?

> If I do a readfile() request to that SHTML file through PHP3.0.15, I ALWAYS
> get a Netscape based response, even when the calling PHP3 knows that it was
> called from an IE browser.  This is no doubt due to the HTTP 1.0 connection
> used (To quote the online PHP manual:)
>
>   If filename begins with "http://" (not case sensitive),
>   an HTTP 1.0 connection is opened to the specified server
>   and the text of the response is written to standard output.
>
> This is nice, and things like .CGI's and other scripts can be used this
> way - but not completely transparently as can be seen in my case (and this
> will of course fail when referencing a name-based host... something thats
> becoming more and more prevalent these days).
>
> But obviously it's not a FULL HTTP 1.0 connection - other wise it would have
> a
>
>   User-Agent:
>
> line in the request header, wouldnt it?

It is a full connection and a User-Agent header is sent.  The user agent
is reported accurately as "PHP" followed by a version number.  It is not
Netscape nor IE making this HTTP request, it is PHP.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Scott Brown


> > If readfile is indeed that "broken", maybe we can talk the
> > powers that be into dumping full HTTP headers through the
> > readfile call in a future version I mean, the main
> > script has it already from when it was called... so it
> > should be able to sub-call pages in that same context.
>
> readfile() is not broken at all.

"broken" was in quotes for a reason... yes, it works the way the docs say -
but it doesnt work well enough in light of the fact that virtual gives me
garbage.

If I do a browser based connect to that SHTML file, I'll get a IE based
response when I use IE, and a Netscape response when I use Netscape.

If I do a readfile() request to that SHTML file through PHP3.0.15, I ALWAYS
get a Netscape based response, even when the calling PHP3 knows that it was
called from an IE browser.  This is no doubt due to the HTTP 1.0 connection
used (To quote the online PHP manual:)

If filename begins with "http://" (not case sensitive),
an HTTP 1.0 connection is opened to the specified server
and the text of the response is written to standard output.

This is nice, and things like .CGI's and other scripts can be used this
way - but not completely transparently as can be seen in my case (and this
will of course fail when referencing a name-based host... something thats
becoming more and more prevalent these days).

But obviously it's not a FULL HTTP 1.0 connection - other wise it would have
a

User-Agent:

line in the request header, wouldnt it?

> It is silly to use readfile() to access the local server.
> virtual() does that just fine.  Having readfile() lie about
> the browser type that it is and send along fake headers  would
> not be a good idea.  If you want to do something like that use
> fsockopen() and connect to port 80 of your server and send all
> the fake headers you want.

I tried virtual - but in doing so, I lost everything except what preceeded
the virtual call (which is pretty much right at the top of the page, being
as it calls the standard page headers/formatting).

This made virtual useless to me, on my server (running php3.0.15 - maybe it
works better under 4, but I dont have that option right now)

Include doesnt work, as it doesnt process the SHTML, require also doesnt do
what I need.

Thus readfile() (even if it's not the best idea) actually worked better than
any of the more desirable alternatives.

So it looks like I will have to use the fsockopen() method - since the
"non-broken" readfile() routine doesnt handle User-Agent properly.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Rasmus Lerdorf

> If readfile is indeed that "broken", maybe we can talk the powers that be
> into dumping full HTTP headers through the readfile call in a future
> version I mean, the main script has it already from when it was
> called... so it should be able to sub-call pages in that same context.

readfile() is not broken at all.  It is silly to use readfile() to access
the local server.  virtual() does that just fine.  Having readfile() lie
about the browser type that it is and send along fake headers would not be
a good idea.  If you want to do something like that use fsockopen() and
connect to port 80 of your server and send all the fake headers you want.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Scott Brown

Well, it means redeveloping the entire site then - i'm just trying to add
one PHP page to a couple of dozen others that are entirely built out of
pieces of SHTML - not reinvent the wheel (I'm not getting paid for my time
here - it's volunteer work ;-)

If readfile is indeed that "broken", maybe we can talk the powers that be
into dumping full HTTP headers through the readfile call in a future
version I mean, the main script has it already from when it was
called... so it should be able to sub-call pages in that same context.

Maybe they'll like it without all the site menus and headers.(well,
it's worth asking...)

> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 14, 2001 12:02 AM
> To: Scott Brown
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Mixing PHP3 & SSI
>
>
> Well, your readfile() method will never work in any version
> of PHP.  Why
> not just port all your SSI stuff to PHP?  There is nothing
> you can do in
> SSI that you can't easily do in PHP.
>
> -Rasmus
>
> On Sun, 14 Jan 2001, Scott Brown wrote:
>
> > I tried virtual first - but it didnt work.
> >
> > it grabbed the first  call, processed it,
> and then forgot
> > about the rest of the page.
> >
> >
> >
> > > -Original Message-
> > > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, January 13, 2001 11:56 PM
> > > To: Scott Brown
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Re: [PHP] Mixing PHP3 & SSI
> > >
> > >
> > > Why did you decide not to use virtual?  The readfile()
> method you are
> > > using turns PHP into the browser and it makes a completely
> > > new request to
> > > your web server.
> > >
> > > -Rasmus
> > >
> > > On Sat, 13 Jan 2001, Scott Brown wrote:
> > >
> > > > Ok - I thought I saw that it could be done, so I tried
> > > it... and I almost
> > > > got it working.
> > > >
> > > > But rather than one simple layer, I've got SHTML that calls
> > > other SHTML and
> > > > so on it made changes really simple until now ;-)
> > > >
> > > > So anyways, rather than use  I've replaced my
> > > >
> > > > 
> > > >
> > > > with
> > > >
> > > > 
> > > >
> > > > and renamed the page to .php, and it works - EXCEPT.
> > > >
> > > > The processing of the readfile does NOT pass through
> > > sufficient information
> > > > for a browser determination against the HTTP_USER_AGENT
> variable.
> > > >
> > > > Everything I'm receiving is from the "else side" of the
> > > >
> > > >  
> > > > ie specific
> > > > 
> > > > netscrap specific
> > > > 
> > > >
> > > > Is this a known bug in PHP3(.0.15) thats fixed in PHP4, or
> > > have I stepped in
> > > > it again?
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Rasmus Lerdorf

Well, your readfile() method will never work in any version of PHP.  Why
not just port all your SSI stuff to PHP?  There is nothing you can do in
SSI that you can't easily do in PHP.

-Rasmus

On Sun, 14 Jan 2001, Scott Brown wrote:

> I tried virtual first - but it didnt work.
>
> it grabbed the first  call, processed it, and then forgot
> about the rest of the page.
>
>
>
> > -Original Message-
> > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, January 13, 2001 11:56 PM
> > To: Scott Brown
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Mixing PHP3 & SSI
> >
> >
> > Why did you decide not to use virtual?  The readfile() method you are
> > using turns PHP into the browser and it makes a completely
> > new request to
> > your web server.
> >
> > -Rasmus
> >
> > On Sat, 13 Jan 2001, Scott Brown wrote:
> >
> > > Ok - I thought I saw that it could be done, so I tried
> > it... and I almost
> > > got it working.
> > >
> > > But rather than one simple layer, I've got SHTML that calls
> > other SHTML and
> > > so on it made changes really simple until now ;-)
> > >
> > > So anyways, rather than use  I've replaced my
> > >
> > >   
> > >
> > > with
> > >
> > >   
> > >
> > > and renamed the page to .php, and it works - EXCEPT.
> > >
> > > The processing of the readfile does NOT pass through
> > sufficient information
> > > for a browser determination against the HTTP_USER_AGENT variable.
> > >
> > > Everything I'm receiving is from the "else side" of the
> > >
> > >  
> > >   ie specific
> > > 
> > >   netscrap specific
> > > 
> > >
> > > Is this a known bug in PHP3(.0.15) thats fixed in PHP4, or
> > have I stepped in
> > > it again?
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Scott Brown

I tried virtual first - but it didnt work.

it grabbed the first  call, processed it, and then forgot
about the rest of the page.



> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 13, 2001 11:56 PM
> To: Scott Brown
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Mixing PHP3 & SSI
>
>
> Why did you decide not to use virtual?  The readfile() method you are
> using turns PHP into the browser and it makes a completely
> new request to
> your web server.
>
> -Rasmus
>
> On Sat, 13 Jan 2001, Scott Brown wrote:
>
> > Ok - I thought I saw that it could be done, so I tried
> it... and I almost
> > got it working.
> >
> > But rather than one simple layer, I've got SHTML that calls
> other SHTML and
> > so on it made changes really simple until now ;-)
> >
> > So anyways, rather than use  I've replaced my
> >
> > 
> >
> > with
> >
> > 
> >
> > and renamed the page to .php, and it works - EXCEPT.
> >
> > The processing of the readfile does NOT pass through
> sufficient information
> > for a browser determination against the HTTP_USER_AGENT variable.
> >
> > Everything I'm receiving is from the "else side" of the
> >
> >  
> > ie specific
> > 
> > netscrap specific
> > 
> >
> > Is this a known bug in PHP3(.0.15) thats fixed in PHP4, or
> have I stepped in
> > it again?
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mixing PHP3 & SSI

2001-01-13 Thread Rasmus Lerdorf

Why did you decide not to use virtual?  The readfile() method you are
using turns PHP into the browser and it makes a completely new request to
your web server.

-Rasmus

On Sat, 13 Jan 2001, Scott Brown wrote:

> Ok - I thought I saw that it could be done, so I tried it... and I almost
> got it working.
>
> But rather than one simple layer, I've got SHTML that calls other SHTML and
> so on it made changes really simple until now ;-)
>
> So anyways, rather than use  I've replaced my
>
>   
>
> with
>
>   
>
> and renamed the page to .php, and it works - EXCEPT.
>
> The processing of the readfile does NOT pass through sufficient information
> for a browser determination against the HTTP_USER_AGENT variable.
>
> Everything I'm receiving is from the "else side" of the
>
>  
>   ie specific
> 
>   netscrap specific
> 
>
> Is this a known bug in PHP3(.0.15) thats fixed in PHP4, or have I stepped in
> it again?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]