Welcome to Geeklog Friday, May 24 2013 @ 01:02 AM EDT
|
||||||||
![]() |
Forum Index > Support > General Geeklog Support |
New Topic
|
Post Reply
|
PHP include not working in staticpages |
|||
| Anonymous: Rob |
|
||||||
|
|
I have turned on php and selected the "execute php" option and it doesnt display anything, it works on a non geeklog page and i really dont want to use a tacky iframe tag, is there anything i need to do to get this to work?
|
||||||
|
|||||||
| Dirk |
|
||||||
![]() ![]() ![]() ![]() ![]() Admin ![]() Status: offline ![]() Registered: 01/12/02 Posts: 13027 |
It works. You just need to make sure you're using the correct path. For a static page, the "staticpages" directory is the current path. Unless it's a centerblock, then it's the public_html directory. Use $_CONF['path'] or $_CONF['path_html'] to get the correct absolute path.
(just guessing what the problem may be since you didn't provide a lot of information) bye, Dirk |
||||||
|
|||||||
| Anonymous: Rob |
|
||||||
|
|
Hi Dirk,
Sorry i didnt provide much info Basically i have got an external page which i which to integrate into my staticpage, usually i would use the HTML "iframe" tag but i have found that to become tacky looking so i researched PHP and found the "php include" tag. So i have enabled php and used the tag: <?php include("menu.php" when i use this tag on an ordinary php page it works fine and displays the file "menu.php". BUT when i use the exact same tag in a static page it displays absolutely nothing. If there anything in the staticpages plugin that blocks this? |
||||||
|
|||||||
| beewee |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member Status: offline ![]() Registered: 08/05/03 Posts: 969 |
A php-enabled static page has already the php tags, so this is enough:
PHP Formatted Code include("menu.php");Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net |
||||||
|
|||||||
| Anonymous: Adam Dube |
|
||||||
|
|
it does not work either with your method, excluding the <? ?>
please help someone thanks |
||||||
|
|||||||
| Laugh |
|
||||||
![]() ![]() ![]() ![]() ![]() Admin ![]() Status: offline ![]() Registered: 09/27/05 Posts: 876 |
Dirk's code does work, you probably just have the file in the wrong spot.
I did a quick test and if you keep the line of code the same: PHP Formatted Code include("menu.php");then menu.php needs to go in the following directory: path_to_geeklog\plugins\staticpages\ Basically in the same directory as the staticpages functions.inc file since this is the file that is actually executing the php. If you still get an error then it may be a php problem in your menu file. Try putting just a simply echo statement in the file to see if that works. Tom |
||||||
|
|||||||
| Content generated in: 1.48 seconds |
|
|
|