473,471 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

include a file which is out side the folder which contains the code..

23 New Member
hii all,
is it not possible to include a file which is outside the folder which contains the script file(where include( ) is used).
my problem is:

the file add.php uses the
include'../addressbook/image_upload.php' ;
and add.php has path like
addressbook/admin/add.php

by doing so i am getting the following error..


Warning: main(../addressbook/image_upload.php): failed to open stream: No such file or directory in /hsphere/local/home/wwwuser/home.mishra.biz/addressbook/admin/add.php on line 65 Warning: main(): Failed opening '../addressbook/image_upload.php' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php4ext/php/') in /hsphere/local/home/wwwuser/home.mishra.biz/addressbook/admin/add.php on line 65

plese help me if u know..
thanks...
Dec 5 '07 #1
3 1398
Markus
6,050 Recognized Expert Expert
hii all,
is it not possible to include a file which is outside the folder which contains the script file(where include( ) is used).
my problem is:

the file add.php uses the
include'../addressbook/image_upload.php' ;
and add.php has path like
addressbook/admin/add.php

by doing so i am getting the following error..


Warning: main(../addressbook/image_upload.php): failed to open stream: No such file or directory in /hsphere/local/home/wwwuser/home.mishra.biz/addressbook/admin/add.php on line 65 Warning: main(): Failed opening '../addressbook/image_upload.php' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php4ext/php/') in /hsphere/local/home/wwwuser/home.mishra.biz/addressbook/admin/add.php on line 65

plese help me if u know..
thanks...
by doing:
include("../addressbook/image_upload.php");
would take you back to the address/ directory and then search for a sub directory named /adressbook/

dont forget by going back ONE directory from where you already are, you dont have to include the directory name; just the file name

try:

include("../image_upload.php");

:)
Dec 5 '07 #2
mishrarajesh44
23 New Member
hii markusun,
thanks that 'include' works well.. but i am facing another error..
see the error msg below..

Warning: copy(images/DSC00026.JPG): failed to open stream: No such file or directory in /hsphere/local/home/wwwuser/home.mishra.biz/addressbook/image_upload.php on line 15

and in line 15 the code is:
Expand|Select|Wrap|Line Numbers
  1.  $copy = copy($_FILES['imagefile']['tmp_name'], "$idir" . $_FILES['imagefile']['name']);
  2.  
thanks...a lot..
Dec 6 '07 #3
Markus
6,050 Recognized Expert Expert
It sounds like the directory images/ is not there.
Dec 6 '07 #4

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

Similar topics

4
by: Jerz | last post by:
I have a php file which include() 's a file with variables, and a file with functions. so: <? include("../data/common.inc") ?> <? include("../data/functions.inc") ?> if in the php file i...
2
by: chopper | last post by:
Please excuse the long post but I can't think of shorter way of explaining the issue. Please could someone advise on the following: I'm writing preview functionality for a CMS written in ASP....
4
by: michaaal | last post by:
I have two folders in my website... Folder1 (this is where my #include file is, this is where the style.css is) --Folder2 (Folder2 is inside of Folder1) Folder2 contains a file that has...
5
by: Steve Wofford | last post by:
Why can't I get the following running??? <% Dim GetODBCdsn GetODBCdsn = <!--#include virtual="\connections\sqlconnection.txt" --> Response.Write(GetODBCdsn) %> TIA,
6
by: Gideon de Swardt | last post by:
I am trying to do a server side transformation using an xsl:include in my xslt stylesheet. The include stylesheet is stored /Library/abo.Library.xslt and is included in multiple xslts, one example...
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
5
by: Viken Karaguesian | last post by:
Hello all, I've used the SSI Include command successfully in the past to include frequently used files that are based within my own site. However, what if I was to use a file located in a...
18
by: Steven Borrelli | last post by:
Hello, I am using the <?php include() ?statement on my website for organizational purposes. However, one of my includes contains some PHP code. Is there any way for the server to actually...
2
by: Max2006 | last post by:
Hi, After I right-click on my web application project file and choose "Publish ." and do the publishing, the result publishable files does not include the *.ashx files. Is it by design? How...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.