473,410 Members | 1,916 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,410 software developers and data experts.

Using fopen with a URL...

Hi All

In a section of my code I open some other file via an URL to have that code
executed like in

$raw=fopen("http://webserver/some.php?aaa=$a&bbb=$b");
print "<td>$raw<td>";

This works for me, but is this a recommended way to evaluate such php code
stored in an other file ?

Next question is, if I am not interested in the value of $raw,only in the
execution of the file via fopen, can I move the fopen call in the background
like I can do on Unix using the &.
I do the above with a series of different values for $a and $b in a loop, so
it would improve the speed of this code.

Thanks in advance
Heinz


Jul 17 '05 #1
2 2839
How can that work without a second statement (r, w, etc) in the fopen command? I get an error if I just have the URL--and a "Resource id #2"; it doesn't display the results of the URL for me. :(

Heinz wrote:

In a section of my code I open some other file via an URL to have that code
executed like in

$raw=fopen("http://webserver/some.php?aaa=$a&bbb=$b");
print "<td>$raw<td>";

This works for me, but is this a recommended way to evaluate such php code
stored in an other file ?

Next question is, if I am not interested in the value of $raw,only in the
execution of the file via fopen, can I move the fopen call in the background
like I can do on Unix using the &.
I do the above with a series of different values for $a and $b in a loop, so
it would improve the speed of this code.

Jul 17 '05 #2
Eep˛ wrote:

Don't top post
How can that work without a second statement (r, w, etc) in the fopen command? I get an error if I just have the URL--and a "Resource id #2"; it doesn't display the results of the URL for me. :(


See http://www.php.net/file_get_contents

(fsockopen with fputs/fgets might be better, though, because it supports
timeouts)

JW
Jul 17 '05 #3

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

Similar topics

3
by: Ming | last post by:
When I use fopen on the URL: fopen("http://home.pchome.com.tw/world/qoo4ko/110.jpg";, "r") I would get the following error message: -----------Error Message------------ Warning: fopen():...
3
by: James | last post by:
Hi guys, I have been building a search engine here - not because I have plans of dethrowning Google but as a simple app upon which to develop a function set that I can use for other things. ...
28
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
7
by: andylcx | last post by:
Hi all: The c++ language can check whether the file exist or not. I am wondering how c language does this job? Thanks a lot! Andy
0
by: filmo | last post by:
I've got a script that is receiving a PUT request from a Java Applet. To access the PUT data, the php script contains: $putdata = fopen("php://input","r"); error_log("PUTDATA = $putdata Last...
25
by: subramanian100in | last post by:
Consider the following program: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { if (argc != 2) { printf("Usage: <program-name<text-file>\n");
24
by: allpervasive | last post by:
hi all, this is reddy, a beginner to c lang,,here i have some problems in reading and modifying the contents of a file,, hope you can help to solve this problem. Here i attach the file to be...
20
by: cscorley | last post by:
For some reason, I cannot use fopen() on the file in write mode. The file "time" is in the same directory as the .php file, with permissions set to 0766. PHP Version 5.2.5 Apache/2.2.8 code...
4
by: bmerlover | last post by:
How can you read a file in a timer function? I am currently using a do while statement to read a file which works fine. The implementation is in C but I've added the code to a C++ .NET framework GUI...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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 project—planning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.