You are here: Re: $x = fopen ressource as as get parameter. « PHP Programming Language « IT news, forums, messages
Re: $x = fopen ressource as as get parameter.

Posted by Pedro Graca on 10/06/06 13:17

Bob Bedford wrote:
> I'm trying to pass a fopen() ressource result as a parameter.
>
> $x=fopen($filename);
> header('location:myfile.php?ressource='.$x);
>
> but it doesn't seem to work.

When the script ends (after the header() call) the file gets closed and
the resource terminated. There is no way to pass a resource (any
resource, not just a open file handle) to other scripts; you can't do it
with URL parameters nor with POSTed data nor with cookies nor with
session variables.

> How to do so ?

Pass the name of the file and reopen it.

header('Location: http://www.yourserver.com/path/to/myfile.php?filename=' . urlencode($filename));
exit(0);


myfile.php
// validate $_GET['filename']
$f = fopen($_GET['filename']);

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

 

Navigation:

[Reply to this 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

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