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
Old 05-01-2008, 09:49 AM offsite config.php
Registered User

Posts: 255
Trades: 4
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
internetking is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-01-2008, 06:17 PM Re: offsite config.php
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
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.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
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
Web Design Made Simple

Posts: 1,228
Trades: 0
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
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
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');
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Reply     « Reply to offsite config.php
 

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.66980 seconds with 12 queries