/    Sign up×
Community /Pin to ProfileBookmark

php redirection

i have one main directory which has 3-sub directory, named as [B][COLOR=Blue][ inc, products, and images ], [/COLOR] [/B]
inc directory consists on three files named as [COLOR=Navy]links.php, memberinfo.php, and login.php[/COLOR]<br /><br />

products directory consists on file named as [COLOR=Navy]ctegory.php, products.php and product detail.php[/COLOR]
there is also an main.php on maon directory.<br /><br />

i include [COLOR=Navy][ login.php & member.php ][/COLOR] page from[B][COLOR=Navy] inc directory[/COLOR][/B] on each files on the directory of products [ ctegory.php, products.php and product detail.php ], if member is not register then login.php page show else member.php page display including main.php<br /><br />

the problem is that if i manage [COLOR=Navy][ links of links.php ][/COLOR] for main.php then there is problem with inc directory pages, and if i mange [COLOR=Navy][ links of links.php ][/COLOR] according to inc directory then main.php links does’t work.<br /><br />

i want to solve this problem so that in no. of directory i can manage no of links by using the single links.php file on each directory<br /><br />

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 19.2006 — If I correctly understand your problem, probably the two simplest solutions are:

  • 1. Add the "inc" directory to the "include_path" in your php.ini file (or via .htaccess if running on Apache) and then just include by filename.


  • -- or --

  • 2. Use a full path to all include files, e.g.:
    [code=php]
    include $_SERVER['DOCUMENT_ROOT'] . '/inc/links.php';
    [/code]
  • ×

    Success!

    Help @mahfooz spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...