Re: Re: writing source code to file
| From: | Hannes Magnusson | Date: | Tue, 17 Aug 2004 23:59:37 +0000 |
| Subject: | Re: Re: writing source code to file | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194110@lists.php.net to get a copy of this message | ||
On Tue, 17 Aug 2004 19:34:18 -0700
holmes072000@charter.net (John Holmes) wrote:
> Hannes Magnusson wrote:
>
>
> >>>>file_get_contents("http://www.yoursite.com/script.php");
> >
> > I belive that this method will hang for ever since the script
> > doesnt exit until file_get_contents() has got the complete results..
> > ...and the complete results wont be ready until file_get_contents()
> > returns.
>
> There are no problems with using a method like this.
You really think that this works? getting contents from the file currently running?
I not only doubt it, I *know* it wont work.
Try this out:
<?php
$url = "http://" .$_SERVER[ "HTTP_HOST" ].$_SERVER[
"REQUEST_URI" ];
$string = file_get_contents ( $url );
?>
This really what you are proposing?
Works fine as long as you run file_get_contents() on diffrent file.
- Hannes
>
> --
>
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals ___ www.phparch.com