Forum Moderators: coopster
web2.php:
<?
$BASE_DIR=".";
$BASE_URL=".";
require_once("lib/common.php");
page("web2");
?>
So, a page called web2.htm gets inserted in th middle of my template.
I am having a terrible time. I want to insert a link exchange script. The instructions say that you can put a line of code into any page and it will call the script.
Well, I created a page called web3.htm, and I put the following in it:
<?php
require_once("../partners/include_categories.php");
?>
However, include_categories.php just refuses to load. I have tried anything I can imagine, I have parsed php htm pages, so that shouldn't be a problem. I just can't get my script to show on the page. Can anyone give me an idea of what is wrong? If I go directly to web2.htm, I can see the script, but I just can't find a way to insert it into my website. If you need a URL so you can check out the site, please send me a sticky, this is just so damm frustrating!
Thank you
php_value include_path ".:/server/path/to/your/includes"
This is assuming the script is running on a *nix machine, if it's running on windows and your stuff is on c: it's this:
php_value include_path ".;c:/server/path/to/your/includes"
.:/ or .;c:/ that is.
includes would be your includes folder, generally it's considered a good idea to not have your includes folder be accessible over the web,
ie: /www/usr/yoursitemainfolder/sitefolder/includes
is not as good as
/www/usr/yoursitemainfolder/includes
then when you include the file on the page, you only have to put the path to the includes from the includes folder, which is now acting like the root directory for your includes, like this:
include("yourfile.php");
this works anywhere on your site.
Oh, I forgot, if you do use .htaccess to do this, make sure you include a linebreak after the last line of code on the .htaccess file, otherwise you may get a 500 server error when you try to access the site.
If you don't know what your .htaccess file is, check your site root folder for that file, download it, in ASCII mode, not Binary, save it as .htaccess, upload it. If you don't have that file, make one in a text editor, save it as .htaccess, then upload it.
, since htm files are getting parsed, and php files aren't?
I would try that, see if it works, then try commenting out the removeHandler line:
#RemoveHandler....
upload it and see if it works.
Then try putting some gibberish in a file, save it as .htaccess in a non root directory, make one called 'test', have that .htaccess file in there, then try accessing a test file in that directory, this is to make sure that your webserver is even using .htaccess files. That's good to determine for sure before going on.
if you make a file /test/test.htm and a file /test/.htaccess
and then put some random characters in the .htaccess file, like
oaww;oteijha;efja;
you should get a 500 server error when you try to access /test/test.htm, if you get no error then your server is not allowing you to run .htaccess files.