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
[Back to original message]
|