473,749 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

including a file outside the accessable area

258 Contributor
Hi everyone
Does anyone know how to include a file outside the HTDOCS root?

When I login to my ftp htdoc is the folder where I put my index.php but I want to put a file outside this folder and include it in the index file

Expand|Select|Wrap|Line Numbers
  1. file.php
  2. HTDOCS (folder)+
  3.                |
  4.                -index.php
  5.  
I just need to know what address I should use to include file.php
Oct 14 '07 #1
1 1222
pbmods
5,821 Recognized Expert Expert
Heya, bnashenas1984.

Use a relative path, or add it to your include_path. For example:
Expand|Select|Wrap|Line Numbers
  1. require_once dirname(__FILE__) . '../privateIncludes/file.php';
  2.  
Alternatively:
Expand|Select|Wrap|Line Numbers
  1. ini_set( '/absolute/path/to/include/folder:' . ini_get('include_path') );
  2. require_once 'file.php';
  3.  
Oct 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1259
by: Jim Walseth | last post by:
We are creating a zip file with ZipFile and it's contents are not accessable under XP 2002. File size is correct, and file is good under Win 2000 (WinZip) and Win98SE (pkzipw). Under XP, double-clikcing opens a window, but the file list is empty. python verion == '2.1.1 (#20, Jul 26 2001, 11:38:51) ' usage: zip = zipfile.ZipFile(zipname, "w", zipfile.ZIP_DEFLATED) zip.write(src, dst)
14
10998
by: Reply Via News Group Please | last post by:
Folks, I'm new to CSS and realise that by posting in the html newsgroup, I might upset one or two readers by raising a CSS question in an html newsgroup however my ISP only has one small CSS newsgroup available - I'm hoping someone here might be able to help. I have an external style sheet which I call/install from inside my head tags like so:
7
2783
by: Brian Sabolik | last post by:
I'm not sure if I've broken any Object Oriented rules or not, but ... I have projects in 2 different solutions that need to use each other's methods. Therefore I may have an "update" method in project 1-solution A accessing a "save" method in project 2-solution B as well as "getinfo" method in project 2 accessing a "read" method in project A. Is this permitted? I am getting the "dependency file in project cannot be copied... conflict...
6
2169
by: juglesh | last post by:
hello, here is my dir structure: /private mainaction.php img.jpg /public_html index.php in index.php, I include mainaction.php. In mainaction.php, i want to
31
3604
by: Joseph Wakeling | last post by:
Hello all, I'm writing some programs that will be using modules from the GNU Scientific Library (GSL). Include commands within the GSL modules have commands such as, #include <gsl/gsl_rng.h> (for example). Yet these header files aren't actually in the gsl
8
3712
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box and save it to a file. This step is not to hard however the contents of the textarea is mostly latex source so it contains just about every special character you can imagine. My question is this, how do I save an exact copy of the textarea...
0
2067
khalidbaloch
by: khalidbaloch | last post by:
i have installed IIS server on my windows xp sp 2 machine .and it is accessable in my local area network ,, i am connected through dsl/cable .i want to make my local webserver accessable on the net .. How do u that ........... any help would be highly appreciated .......
1
5681
by: BaaZauq | last post by:
Hello everybody! I'm not a master of clientside JavaScript but I have much working knowledge of it. Here is my problem : I have a web-page with a "text-area" box. I have an excel file with 10 columns and 15 rows. each cell has a unicode-text data stored in it. I want to show two drop-down menus along side with the above said text-area.
2
2509
by: Sagaert Johan | last post by:
Hi I want to draw grips around my usercontrol. Becorse the grips are around the customcontrol they are outside the controls drawing area. I tried setting the Region to infinit but that does not seem to work. Any hints or workarounds ? Johan
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.