Forum Moderators: coopster

Message Too Old, No Replies

"include" not working on .php pages.

         

Acternaweb

4:01 pm on Jan 6, 2004 (gmt 0)

10+ Year Member



Currently I have .shtml pages that use
<!--#include virtual="/menu/phpddm.php -->
to display my menu. It works great until I come on a .php page. How do I get the same script to run on those pages? Please tell me it is possible.

Thanks,

bcolflesh

4:02 pm on Jan 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



php.net/include/

Acternaweb

5:09 pm on Jan 6, 2004 (gmt 0)

10+ Year Member



yeah I read and tried that, but what happens is when I put the include into the .php page I get an error from the script being included that a required file is in the wrong directory. Basically if I fix the file location for one error it causes another. I have tried to hard code the full url too.

Miki

8:14 am on Jan 8, 2004 (gmt 0)

10+ Year Member



Could you please post the exact error message?

I don't know if I have anything to offer, but I'm quite curious as to why this doesn't work (it should in theory, no?). :)

mep00

8:33 am on Jan 8, 2004 (gmt 0)

10+ Year Member



What about changing the page to .php, and then use
<?php include("/menu/phpddm.php")?>
?

superpower

9:01 am on Jan 8, 2004 (gmt 0)

10+ Year Member



On the php pages use the php include command to call the php file. On the shtml files use the ssi include command to call the php file.

The menu.php file is the same. Is that what you are looking for?

You can't call an shtml file from a php page with an ssi include.

Acternaweb

10:43 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



No just the opposite, I am trying to "call" a php script on to a .shtml page and it wont work

ergophobe

12:14 am on Jan 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



May I ask why? Why not just make it a php page and use include? It seems like it would simplify things in several ways.

Acternaweb

2:42 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



Sure, I am using a script that I got from Hot Scripts and said to call it that way.

This is what happens when I make the index.shtml index.php. The page does load 2 of the scripts

Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/sports.greens2003.com/httpdocs/index.php on line 22

Warning: Failed opening '/dh/index.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/sports.greens2003.com/httpdocs/index.php on line 22
>


Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/sports.greens2003.com/httpdocs/index.php on line 39

Warning: Failed opening '/cutenews/show_news.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/URL/httpdocs/index.php on line 39

Archives
Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/URL/httpdocs/index.php on line 46

Warning: Failed opening '/cutenews/show_archives.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/URL/httpdocs/index.php on line 46