Results 1 to 2 of 2

Thread: How to get a PHP file to be included across files in different directories?

  1. #1
    Join Date
    Jan 2008
    Posts
    1

    Default How to get a PHP file to be included across files in different directories?

    Currently I have created some php based webpages and uploaded them to my web hosting server.It has a PHP 5.1.6
    installed.With this I am able to include files only that are in the same directory(they work well using require() fn).If not an error message displaying some "no such file" in directory appears in the page.I would like to use them to be included in different direcetories.What should I do?
    Powered by Yahoo!

  2. #2
    Join Date
    Jan 2008
    Posts
    1

    Default

    create the directories and include the names when using the require() function.

    example :

    your index.php is in the root directory
    /index.php
    and you have a directory with your other php files in
    /lib/other.php

    so in index.php you will have

    require("lib/other.php");
    Powered by Yahoo!

Tags for this Thread

Bookmarks

Posting Permissions

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