Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
include between http and https
Old 07-16-2009, 03:09 AM include between http and https
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
so i have a plesk server and want to share a single function.php

I've put this in the httpdocs/includes directory (plesk) but want to include from a file in httpsdocs how do i achieve this... I've tried

PHP Code:
include('../httpdocs/includes/function.php'); 
also

PHP Code:
include('/var/www/vhosts/mydomain/httpdocs/includes/function.php'); 
the latter works on files in the httpdocs folder but not the httpsdocs...

any help?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by orionoreo; 07-16-2009 at 03:11 AM..
orionoreo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-16-2009, 04:28 AM Re: include between http and https
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
No much luck here.
Https probably is shared between every users of the hosting facility, and have a different web path.
This means that you must address explicitely the path to your files.
Or have a check done first, and adapt a variable with the correct path prefix, like:
(in pseudo code)
PHP Code:
if protocol=='https' then
 $path
="/var/www/vhosts/mydomain/httpdocs";
else
  
$path=$_SERVER['DOCUMENT_ROOT']; 
and use this $path variable when you do includes.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 07-16-2009 at 04:30 AM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to include between http and https
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12490 seconds with 12 queries