Reply to Re: How to get contents of a file with querystring ?

Your name:

Reply:


Posted by Norman Peelman on 08/28/07 03:28

Pugi! 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&param2=log&param3=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&param2=log&param3=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!
>

file_get_contents() is expecting to find a file named:

file.php?param1=12&param2=log&param3=5

and is not finding it (of course). If you try to open just file.php
you'll see you get a valid resource. You probably want to use fopen()
or another.

Norm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация