PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hai iam newbie in php. so i want to make a template for side menu
include("sidemenu.php"); just like this when i use this in subfolders getting 404 error how can i get rid of this.
please help me and i'm also want to span the same page how can i use sidemenu.php template in all pages.
hey bro i just want to know
in this page folder1/page1.php
index.php linked as ../index.php
if using php template for side menu
the link is ../index.php
if
using folder1/another_folder/apage.php
here the link of index.php would be ../../index.php
so
the template link not work
how can i fix this using one template for all pages.........
and
also
in folder1/another_folder/apage.php the same page link not work in that page, i also want to config in the same page..... how can i code yaar please help me
It would be better if you define some named constant using define() and use them out in loading file resources of your application.
like below you can have few named constant, that can help you out to load resources.
[syntax=php]<?php
define('APP_ROOT', 'Put value as per your need'); // path to your root directory
define('PATH_LIB', 'Put value as per your need'); // path to your library directory
define('PATH_MODULE', 'Put value as per your need'); // path to your module directory
......
?>[/syntax]
Last edited by Benjamin on Thu Jan 13, 2011 3:03 am, edited 1 time in total.
Reason:Added [syntax=php] tags.
include $_SERVER['DOCUMENT_ROOT'] . '/sidemenu.php';
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.