Reply
offsite config.php
Old 05-01-2008, 09:49 AM offsite config.php
internetking's Avatar
Extreme Talker

Posts: 245
Hi all

ok this is what im trying to do:

I have a php site up and i want to use the config.php file from a differnt site to pull in the info.

this is the top of the index.php

PHP Code:
<?php include("http://www.limaservices.com/offsiteconfigs/tips_config.php"); ?>
<?php
?>
The file is at the url

then im adding adding this to the code on the site where i want to pull in the info.
PHP Code:
<?php echo $site1_name ?>

But alas nothing is showing up, im getting no errors so im lost .
Prob me being thick again but any help would be appreciated.

Thanks
mark
__________________
MSN support@internetking.info
internetking is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-01-2008, 06:17 PM Re: offsite config.php
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 5,881
Name: Dan
Location: Swindon
You have to have a majorly unsecure server to allow a external include.

and when it does include the tips_config.php will be parsed so you only get the html output which is probs nothing.

So it wont work.
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 05-01-2008, 06:34 PM Re: offsite config.php
VirtuosiMedia's Avatar
Webmaster Talker

Posts: 599
If you're trying to get data from another server or domain, do some research on web services. Specifically, XML-RPC, SOAP, and REST.
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 05-02-2008, 10:42 AM Re: offsite config.php
nickohrn's Avatar
Weightlifting CS Student

Posts: 505
Name: Nick Ohrn
internetking - Including files from a separate domain is a really bad idea, in general, and most PHP setups don't allow it. If I were you, I would just copy the configuration file over to your new sites directory. If you're hosting the two sites on the same server, you could put the the file outside the web root and reference it dynamically.

Assuming the following file structure

-www
--site1.com
---etc
---etc2
--site2.com
---etc
---etc2

Put the file you want included inside the www folder (assuming its not web accessible) and include from the site1 and site2 directories with

require_once('../file_to_include.php');
__________________
Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
nickohrn is offline
Reply With Quote
View Public Profile Visit nickohrn's homepage!
 
Reply     « Reply to offsite config.php
 

Thread Tools

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 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.12624 seconds with 13 queries