Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-15 11:01:58

stef25
Member
Registered: 2005-12-26
Posts: 88

How do I ... include external scripts

When using the code below i get the following error

“tag_error <txp:php> -> Warning: require() [function.require]: URL file-access is disabled in the server configuration on line 2”

Does anyone know what I’m doing wrong? Is this a problem with my host configuration (dreamhost)?

This is my code, its wrapped in txp:php tags

require(“http://domain.com/new/file_download/1”);

Last edited by stef25 (2006-06-15 11:03:04)


I need someone to protect me from all the measures they take in order to protect me

Offline

#2 2006-06-15 11:16:17

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: How do I ... include external scripts

When you pass something with “http” to include/fopen/… and related functions, it will only work if the url-wrappers are enabled in your PHP configuration. For security reasons this often gets disabled, which IMHO is a sensible thing to do.

If the code does reside on a different server, you must emulate a HTTP Request, you might use an HTTP-Client class (PEAR has one), or you could do it yourself with fsockopen

If the code is your own code and it’s on the same server, you could simply replace the url with the filesystem path to the file.

Offline

Board footer

Powered by FluxBB