RE: [PHP] What's more common: CGI or module installation?

From: Date: Tue, 01 Aug 2000 02:53:14 +0000
Subject: RE: [PHP] What's more common: CGI or module installation?
Groups: php.general 
Request: Send a blank email to php-general+get-9342@lists.php.net to get a copy of this message
You're probably looking for this: <!-- hello.inc --> Hello, world! <!-- http://www.murphatnight.com/test.php --> <HTML> <BODY> <? include "hello.inc" ?> </BODY> </HTML> This includes the contents of the file hello.inc inside the body tag of test.php. The above assumes that your ISP has configured all files of type .php to be parsed through PHP (either with a module, or a MIME type action). If your server doesn't automatically reroute the file through PHP, then you might be able to do it a different way. If you have access to a cgi-bin directory (one that has ExecCGI privileges in Apache, or the equivalent in another server), you could do the following: - add this line to the top of test.php: "#!/usr/local/bin/php-cgi" (assuming that your PHP cgi binary is located at /usr/local/bin/php-cgi) - upload test.php to your server's cgi-bin directory - set the execute bit on test.php by either: - telnetting to your server and doing a "chmod +x test.php" - or using your ftp program's permissions features That should do it. BTW--The onLoad attribute of the <body> tag is used to run a JavaScript statement once the page is done loading in the user's browser, not for doing backend (server-side) things with PHP. --Bruce Bruce Christensen Intel Corporation brucex.r.christensen@intel.com -----Original Message----- From: Murph [mailto:murph@murphatnight.com] Sent: Monday, July 31, 2000 7:36 PM To: David Robley Cc: php-general@lists.php.net Subject: Re: [PHP] What's more common: CGI or module installation? > At the least,l you should be able to call it as you would any cgi - > something like > > http://your.host/path/to/php/path/to/test.htm > > Depending on the server and the cooperative nature of the ISP, it may > also be possible to add .htaccess file(s) to your web structure to allow > selected, or all, files to be parsed by the php cgi. --- That's reasonable enough and I've had some email from Bruce Christensen that shows exactly how my host should configure their system. I shot them a copy of his message and they're obviously mulling it over. They usually get back to me within 30 minutes even late in the evening on a Sunday. They're pretty good and I like the folks at Hostway.com. With Bruce's message, though, it's been over a few hours and still nothing. I suppose I'll have to wait until the morning when their crack staff get in before I hear back on something this technical. ANYWAY... If I can call PHP as any other CGI script, I think I'm stumped as to how to do something like this: <!-- http://www.murphatnight.com/test.html --> <HTML> <BODY onLoad="http://murphatnight.com/hello.php3"> (hello.php3 echoes "Hello, World!" back into test.html) </BODY> </HTML> Is that a newbie question? I dunno. I *am* fairly new to this but I've crawled all over all kinds of books, docs, and manuals and haven't found the answer. I thought fopen() was the answer but it doesn't quite give the effect I'm looking for. I own (and read) "Professional PHP Programming" from Wrox and have scoured the online PHP manual to no avail. I have this mailing list going and have done the search engine thing with AltaVista. I don't mind buying and reading books but which ones? This one, simple problem is killing me and keeping me up all hours of the night. My work is suffering and my girlfriend can't remember my name so I had to buy a nametag. Am I going down a dead-end or should I keep plugging away looking through more stuff to find what I'm looking for? Got any pointers? Yours in Massachusetts, USA, Murph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#9342) next »