Current location: Hot Scripts Forums » Programming Languages » PHP » include command giving me fits


include command giving me fits

Reply
  #1 (permalink)  
Old 02-12-04, 06:39 PM
midway midway is offline
New Member
 
Join Date: Jan 2004
Location: Texas
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
include command giving me fits

I have a site that uses a copyright date on all pages.

Up until now I have been using the following command.

PHP Code:

<?php require ("includes/copyright.inc"); ?>

However, the site I am working on goes pretty deep in its directories. For example, http://www.site.com/dir1/dir2/dir3/page.php

So I figured if I added ../ I could get the include file to work...no luck I got warnings out the ear.

I even used the following.

PHP Code:

<?php require ("../../../../includes/copyright.inc"); ?>

No luck again.

When I added the http://.. before the path I received a warning telling me something about not supporting seeking.

Any help with this is welcome as I'm about to go nuts.
Reply With Quote
  #2 (permalink)  
Old 02-12-04, 10:19 PM
gforce gforce is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Let me guess, the warning you recieve is like:

Warning: main(): stream does not support seeking in /dir/dir/dir/dir/some_file.php on line ##

So far the only way that I've found around this is to put @ (which suppresses the warning) in front of any include or require that tries to access a remote file via a url.

hope this helps,
gforce
Reply With Quote
  #3 (permalink)  
Old 02-12-04, 11:31 PM
nd2 nd2 is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
try just 3 back dirs

../../../includes/copyright.inc

anouther option is to use absolute paths instead of relative paths, insert this file to your includes directory and call it from your browser

<?php
echo getcwd();
?>

this will output the absolute path for that folder you can then use this in your require statment.
__________________
IonCMS (Coming Soon.)
http://ioncms.com
--
Ncaster (Free php/mysql cms)
http://ncaster.cjb.net
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I include external script jimpy ASP 3 05-24-04 06:39 AM
PHP include on vBulletin Matrix28 PHP 2 02-25-04 12:29 AM
include() Dimka PHP 26 09-20-03 07:51 AM
include tag rkiss PHP 1 08-12-03 04:10 AM
"10 most requested pages" script to include in page avx Script Requests 5 08-06-03 03:26 AM


All times are GMT -5. The time now is 08:48 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.