Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder Bengal313's Avatar
    Join Date
    Jun 2002
    Location
    Metro Detroit
    Posts
    298
    Thanks
    8
    Thanked 0 Times in 0 Posts

    "require" with path syntax?

    I have a page called home.php. Then I have a sub folder called vcal which has _config.inc.php, _function.php, and _class_calendar.php. How do I correct the syntax below so it will point to th files correctly which are located in a sub folder called "vcal"? Thax


    <?php
    require "_config.inc.php";
    require "_functions.php";
    require "_class_calendar.php";

    $calendar = new calendar;
    $showcalendar = $calendar->create_currentmonth("150",1);
    ?>
    "Knowledge Speaks But Wisdom Listens"

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Try this...

    PHP Code:
    define("INCLUDES","./vcal/");
    require(
    INCLUDES."_config.inc.php");
    require(
    INCLUDES."_functions.php");
    require(
    INCLUDES."_class_calendar.php"); 
    . = current directory
    .. = parent directory


  •  

    Posting Permissions

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