Using require()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BillBillJr
Forum Newbie
Posts: 9
Joined: Tue Aug 19, 2008 7:43 pm
Location: U.S.A.

Using require()

Post by BillBillJr »

When using require() can you grab a file from a website? For example:

Code: Select all

<?php
require("http://www.mysite.com/files/config.php")
?>
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Using require()

Post by califdon »

First of all, you have to use correct syntax (php statements must end with a semicolon). Whether you can depends on whether the other site permits you to. It's generally not a good idea, since it will surely slow the response of your page, and puts your page at the mercy of what may change on the other site.
Post Reply