TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-18-2008, 05:37 PM   #1 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Confused Absolute URL location not working...

Hello all,

Is there a reason why this:

PHP Code:
include('http://www.domain.com/inc/functions.php'); 
doesn't work.

But this:

PHP Code:
include('inc/functions.php'); 
Does?

This isn't always the truth, but seems to be when calling certain php and .xml files.
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 12-18-2008, 05:38 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

You can not include a file via http.
__________________

Village Idiot is offline  
Reply With Quote
Old 12-18-2008, 05:58 PM   #3 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

can you explain why not? If that is just how it is, that's fine to :)
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 12-18-2008, 06:18 PM   #4 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

Would there be a way to use include even if the file calling it is deep within another directory? I don't want to change the link to the file each time the directory is deeper.

IE... inc/functions.php on home page...

inside AboutUs directory... ..inc/functions.php on aboutus.php

etc...

Thanks!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 12-18-2008, 06:21 PM   #5 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

AH! This explains it:

Quote:
If you use absolute url's for includes then you need to use the file system path, not the web path. As the include is carried out by the server not the browser.

include('/var/www/domains/example.com/htdocs/include/some_file.php');
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 12-18-2008, 06:29 PM   #6 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

Is there any security issues with using the absolute path? Is it safer? Less Safe?

Sorry for all the questions. Thanks for the clarifications!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 12-18-2008, 06:37 PM   #7 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by buildakicker View Post
Is there any security issues with using the absolute path? Is it safer? Less Safe?

Sorry for all the questions. Thanks for the clarifications!
I cant think of any security issues using absolute opposed to relative paths could create.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
buildakicker (12-18-2008)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Absolute Beginner Explains Me! conrad Absolute Beginners 15 01-26-2009 03:21 AM
Exec(zip) in PHP not working as expected oscargodson General 3 09-28-2008 12:00 PM
function that returns an array -- why not working? Dave Absolute Beginners 3 08-13-2008 05:01 PM
Header(location) stop working? marxx General 5 05-06-2008 08:32 PM


All times are GMT. The time now is 07:57 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design