Currently I use SSI to use a standard menu, header, and counter in my 3 dozen or so web pages. If I used PHP includes instead, does my web host need SSI ability? Most hosts allow the use of PHP with the cheaper plans, but not SSI. I would also need to be able to run a CGI script in this fashion.
If yes to the above, can pages be named .html but run as .php and is that an okay way to do it? All of my pages use these includes (menu, header, and counter - 3 files on each page).
I can't "include" a perl/cgi file using php like I do with SSI? I don't know php, I had enough trouble writing it in perl Currently it does log visitor stats. Another cgi/perl script works like Yahoo does and logs stuff via javascript, launched via the IMG tag.
The problem with that is bots would keep hitting the script thinking it was an image for their cache and robots.txt doesn't get obeyed much. And checking for referer doesn't work as most people disable that these days (me included). I do use that technique for my javascript info collector, but it's launched using JS so bots ignore it. But I could do it if needed, or pay the extra $ to do it properly.
It also wouldn't work if people don't display images
FYI, I tried using a PHP include to run a perl/cgi script - no go, doesn't work as SSI is disabled. If running from a .HTML it gives an error, if running from a .PHP it just displays the script as a text file, doesn't run it.
Using IMG doesn't work either, can't execute the script. You can run the script by itself, directly, but doesn't seem to be a way to run it from the HTML or PHP page since SSI is off
Thanks for the advice anyway.
[ Message was edited by: david68 05/26/2006 02:33 pm ]
PHP has nothing to do with SSI. If you see PHP files being displayed as text or HTML pages, your server is not configured. Check it out by sticking the following into a page called as test.php:
And after you are done with your testing, remove this page. It tells you a lot about your server environment variables and server configuration.
I tried that, it just displayed the file as a text file LOL - I even set it with perms of 777. It's a free host - they SAY they offer SSI but they don't allow SSI to execute things, they only allow the echoing functions. My question is would a paid host who offers PHP but not SSI allow CGI/perl scripts to run using php includes? I tried asking the host where I bought my domain, but the guy didn't have a clue as to what I was talking about. It's only a difference of $4 vs $9 or $12 depending on where I go - so it isn't a big deal. Thanks for the info.
And yes, I ran the test.php file as mydomain.com/test.php
>>they SAY they offer SSI but they don't allow SSI to execute things, they only allow the echoing functions.
Sure. Few hosts will allow unfettered access to the full functions of SSI for security reasons. May be they will allow to include files as well. But it is a bit tricky though. You will need to rename the file as something.shtml to make use of the SSI unless you are allowed to change the extension in a .htaccess directive.
>>My question is would a paid host who offers PHP but not SSI allow CGI/perl scripts to run using php includes?
Including a file in PHP is allowed in a standard default configuration. But most - if not all - free hosts will not allow you CGI scripts in the first place - again for security reasons and for extra increased effort in maintaining the server. Most sysadmins have a dim view of hastily strung-together scripts consuming server resources.
I do use .shtml and the scripts work alone, just not when called through an include statement. I can run sample.cgi or sample.php and it works, but can't do a SSI or PHP include to run them - I can do SSI includes to display time and such. This was only one host, most hosts either allow complete SSI or none at all. My original question was can I run my perl scripts through a PHP include and not need SSI at all and would a host who offers PHP allow it even if SSI isn't.
I've learned free hosts are pretty much useless, so will be finding a reliable but affordable paid host (any suggestions out there?). I need SSI/Perl/PHP.
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
You have not yet logged in, or registered properly as a member
You are a member, but no longer have posting rights.
This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.