473,800 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ 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.ph p' ;
and add.php has path like
addressbook/admin/add.php

by doing so i am getting the following error..


Warning: main(../addressbook/image_upload.ph p): 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.ph p' 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 1415
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.ph p' ;
and add.php has path like
addressbook/admin/add.php

by doing so i am getting the following error..


Warning: main(../addressbook/image_upload.ph p): 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.ph p' 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.ph p");
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.ph p");

:)
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.ph p 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
1581
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 then call a function from the functions file, the function doesn't see what values the variables in common.inc are, although
2
1651
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. Currently, when a page is published (physical file created in the website) it contains include directives to pull in commonly used bits of HTML and ASP such as the header and footer of pages. In the preview functionality I want to be able to have...
4
2882
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 this #include statement... <!--#include file="../include.inc"-->
5
1465
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
2926
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 would be /Valuation/ValuationSelect.xslt which is also used on the client side via JavaScript and MSXML2.FreeThreadedDOMDocument.4.0. Client side the include and transformation without any problems but it is when I am trying to do the...
9
8337
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) and two folders (Subfolder 1, Subfolder 2). .......I need to delete File1, File2, File3. Subfolder 1 contains FileA. .......Need to delete FileA. Subfolder 2 contains FileB, FileC, FileD.
5
4068
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 differnt location - a different site altogether? I've Googled different variations of "how to insert an URL using #include" but all of the sites that came up never got beyond "file=" and "virtual=". There may be no more to it that that, but I'm not
18
2848
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 parse the include? I've tried this before, and it did not parse the include. Rather, it included the file as just plain ASCII. ======================= /*EXAMPLE 1*/ /*index.php*/
2
6379
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 can I add *.ashx files to the publish target?
0
9691
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
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9090
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...
0
6813
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.