473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

$x = fopen ressource as as get parameter.

Hi all,

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.

How to do so ?

Bob

Oct 6 '06 #1
4 1884
Bob Bedford wrote:
Hi all,

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.

How to do so ?

Bob

Hi Bob, you don't.
A resource is something you can create for the duration of your script, so
when your script finishes, it is gone.

In your case I would pass the filename, and let the receiving script make
its own resource based on the filename.

Regards,
Erwin Moller
Oct 6 '06 #2
fopen is function that open files.
see this: http://php.net/manual/en/function.fopen.php
Bob Bedford написа:
Hi all,

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.

How to do so ?

Bob
Oct 6 '06 #3
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
Oct 6 '06 #4
Thanks for your help....didn't find out so I guessed it wasn't possible

Bob

Oct 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rolf Hemmerling | last post by:
Hello ! Beginner's question: Howto access .RC/.RES Ressource files with portable C++ code ( BCC,MSVC,GNU-C++, OpenWatcom) ? I just wanna access "local language strings", so that I may...
1
by: serge calderara | last post by:
Dear all, We are bulding an application whcih is multilanguage based with the help of ressources. All language ressources will belongs to the same assembly. Now the idea is that I I need to...
0
by: Jj | last post by:
Hi, I have a web site in ASP.NET which use a compiled ressource file for the french version. (dlls of web controls) My DLLs are in the GAC. My website use the NT authentication and/or the...
0
by: calderara serge | last post by:
Dear all, I have an application which is plan to be language dependant. I have make some testing by using ressource files which have been automatically added to my form by setting the form...
0
by: Progman | last post by:
visual studio 2005 asp.net 2 I added a ressource App_GlobalResources folder to my project. I added to the ressource folder a nice 1024x768 jpg file i set my main aspx file body background to...
0
by: Progman | last post by:
to read the ressources, I execute the following code from my screen files. Is there another shorter way of doing this? Similar to...
1
by: carpediem | last post by:
Hi, I am developing an application in Borland C++ 6, one of my functions opens a file and loads it into the memory. I have never had problems with fopen, but this bug is really weird, fopen...
3
by: siyaverma | last post by:
i am trying to upload csv file from user's computer to main server the code i am using is if(((isset($_GET)) && ($_GET=="yes")) ) { $typefield = $_GET; echo...
2
by: Pieter | last post by:
Hi, I have an Excel file, saved as XML-file, which is put as an embedded ressource in my project. How can I read this Excel file using an OleDbDataAdapter? I know how to read an XML file as...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.