473,549 Members | 5,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$x = fopen ressource as as get parameter.

Hi all,

I'm trying to pass a fopen() ressource result as a parameter.

$x=fopen($filen ame);
header('locatio n:myfile.php?re ssource='.$x);

but it doesn't seem to work.

How to do so ?

Bob

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

I'm trying to pass a fopen() ressource result as a parameter.

$x=fopen($filen ame);
header('locatio n:myfile.php?re ssource='.$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($filen ame);
header('locatio n:myfile.php?re ssource='.$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($filen ame);
header('locatio n:myfile.php?re ssource='.$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('Locatio n: http://www.yourserver. com/path/to/myfile.php?file name=' . urlencode($file name));
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
6744
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 replace the ..RC file to compile a version of my software for a different language.
1
1473
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 get text translated in russian, as i do not speak and write russian at all, I would like to be able to send my customer the ressource file in order...
0
1159
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 basic authentication with impersonation enable. but the french file is not loaded until an administrator access the web
0
1192
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 property Localize =true and select my language. then I have a file named form1.fr-FR.resx in my project. I use then the ressource manager class with...
0
1131
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 the picture name using the property window. i looked in the source to see if everything is fine. it is i run the thing no picture in the background...
0
964
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 "ressource("language1.ressource").key("GuestBook.asax.LabelTitle.Text").Value txs for your answers in advance Dim rr As ResourceReader rr = New ResourceReader(Server.MapPath("~") + Path.DirectorySeparatorChar...
1
3682
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 always returns a NULL pointer. The file exists. I have triple checked it a thousand times in the debugger, moreover I got the path using a standard...
3
22029
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 "<form enctype=\"multipart/form-data\" action=\"$PHP_SELF\" method=\"POST\">
2
1977
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 embedded ressource, and how to read a normal Excel file with an OleDbDataAdapter, but what I need is the combination of the two of them!
0
7455
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7480
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5373
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3504
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.