Results 1 to 2 of 2

Thread: php redirection

  1. #1
    Join Date
    Jul 2005
    faisalabad, punjab, pakistan

    php redirection

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

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

    i include [ login.php & member.php ] page from inc directory 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 [ links of links.php ] for main.php then there is problem with inc directory pages, and if i mange [ links of links.php ] 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 />

  2. #2
    Join Date
    Aug 2004
    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.:
    PHP Code:
    include $_SERVER['DOCUMENT_ROOT'] . '/inc/links.php'
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles