This is a discussion on "include" function help please within the HTML, CSS, and Design Help forums, part of the General category; Hello, im trying to add a calender of events to a right hand side table in the layout.tpl.php and cant ...
|
|||||||
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
im trying to add a calender of events to a right hand side table in the layout.tpl.php and cant get it to work, iv used instructions from http://www.w3schools.com/PHP/php_includes.asp with no joy. im wonderng if i can 'include' a file from within another folder, ie: does the target file have to be in the same folder as the one calling it? |
|
#2
|
||||
|
||||
|
try using {php}{/php} tags
__________________
Super Mod v4 coming very, very soon ![]() Visit Me @ Classified-Sofware.co.uk **Important** - All modules with the exceptions of the Bulk Upload System will be removed from my modshop on Tuesday September 30th. If you require a module you must get it before that date. |
|
#3
|
|||
|
|||
|
do you mean like this?
PHP Code:
|
|
#4
|
|||
|
|||
|
That should work... the only problem I've had at times with php includes is making sure the location of the include file is correct.
Regards, Jim
__________________
V3.1.10 Developer |
|
#5
|
|||
|
|||
|
thanks for that Jim, its just not working. Does the target file need a 'prerequisite' (for lack of a better word) to be included this way?
|
|
#6
|
||||
|
||||
|
You may want to try using the full path. Something like:
{php} include("/home/user/public_html/abc/event.php"); {/php}
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | Submit a Ticket | Twitter |
|
#7
|
|||
|
|||
|
all im getting on the browser side is :
{php} include("/home/user/public_html/abc/event.php"); {/php} the file im trying to include is part of an eloberate calendar script. if i point the browser directly to the file im trying to include, it shows the calendar, so theres no problem there. i just cant add it to the template files to have it show.. |
|
#8
|
||||
|
||||
|
What Eric gave you was an 'example' of a path - it may not be the same as 'your own' actual path. Just checking to see that you understand this?
__________________
Chaslie V3.1.10 dev mods.auscity.com AUSCITY 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals HTML Help W3 Schools |
|
#9
|
|||
|
|||
|
yes, i get that... i wish it were that simple
|
|
#10
|
|||
|
|||
|
This is the entire contents of a test.php page with the correct path.
PHP Code:
Should this work? if i point the browser directly to the file myevent.php i see what i want to see. if i point it to test.php i see: {php} include("/cal/myevent.php"); {/php} i must be doing something fundamentally wrong i think i found the problem, it seems thatyou cant call a file that also uses the include function to call yet another file, unless they are in the same folder...just got to get my head around it.. Last edited by paulsra; 07-09-2008 at 05:48 AM. |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with search function. | Jessej | v3.1 Questions & Support | 7 | 04-06-2008 08:27 AM |
| Import & Bstore function | tipud | v4 Questions & Support | 2 | 09-24-2007 10:37 AM |
| Could not instantiate mail function. | calaf6 | v3.0 Questions & Support | 12 | 02-27-2007 09:38 AM |
| Where is the custom field search function? | MrSpandex | v3.1 Modules & Modifications | 3 | 12-08-2006 06:33 PM |
| Problems with updateOrder function | flyingpylon | v3.1 Questions & Support | 3 | 11-06-2006 08:58 PM |