Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

calling cgi from php script



4:45 am on Aug 18, 2002 (gmt 0)

10+ Year Member

Can you use fopen to open a URL pointing to a CGI script such that the cgi script is executed and you can still process the returned HTML normally? I guess the question is, does fopen execute the cgi script when it gets a pointer to the URL..



6:43 am on Aug 19, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

I don't think the script is executed using fopen() but the answer will be here.

fopen [php.net]

You may have to use require or include. I think there is even an exec function, not sure.

Sorry scorpion, I feel badly when I keep referring to this site but it really is that good.


2:00 pm on Aug 19, 2002 (gmt 0)

10+ Year Member

thanks, I have written some code where fopen points to a cgi script. It seems to work in that fopen contains the returned HTML document. I assume for this to happen, it HAD to run the script, otherwise it wouldn't have gotten the html page...

Featured Threads

Hot Threads This Week

Hot Threads This Month