|
Posted by Pugi! on 08/27/07 12:01
On 27 aug, 12:40, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Pugi! wrote:
> > On 27 aug, 12:13, Pugi! <pugin...@gmail.com> wrote:
> >> For obtaining the contents of a file one can use the file_get_contents
> >> function.
> >> But when I try to use this function to get the contents of file
> >> including a querystring I always get a failed to open stream, no such
> >> file or directory.
> >> $str = file_get_contents('/dir1/dir2/dir3/file.php?
> >> param1=12¶m2=log¶m3=5');
> >> The contents of the file can either be text or json encoded.
> >> For an xml response it works $xml->load('/dir1/dir2/dir3/file.php?
> >> param1=12¶m2=log¶m3=5').
> >> But it should be possible for txt or json too .. I guess ?
> >> What other functions are there to get the contents of a file with
> >> querystring ?
>
> >> thanx,
>
> >> Pugi!
>
> > It is information I want to send from one php file to another.
> > Should I use a specific header when sending json encoded information
> > like one has to in the case of xml ?
>
> > Pugi!
>
> file_get_contents() does just that - it fetches the contents of the
> file. Nothing more, nothing less.
>
> The only way you can pass a query string to a file is to get it through
> the web server - that is, load it as a URL. But that requires an
> additional round trip to the server and added overhead.
>
> Maybe you should rethink your design.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
Hmm, but it works for xml; you can the pass the DOMDocument->load a
path-file-querystring without round trip to the server.
In order to get a response from a file + querystring (for json, text,
html) one always need a round trip to server, except for xml ?
Pugi!
Navigation:
[Reply to this message]
|