TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,234
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 275
  • Total: 275

Empty PHPblock

Started by spellbyte, May 06, 2007, 11:09:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

spellbyte

Hi guys,

well firstly a big thanks for such a great portal system, it rocks.

my problem is that i am trying to include an external .php file from one of my other sites but all i get is a empty box

this is the code i am using in the phpblock

include"http://mysite.com/banner.php";

i tried adding it as an Iframe in an HTML+BBC box, but iframes are crap, any ideas as to what could be preventing it from showing in the PHPblock

Thurnok

Do not use URIs in include statements unless your php has been configured to allow external files in includes.  Instead, use a direct filepath to your file.  Example: include "/direct/path/to/my/htdocs/banner.php";
Thurnok
The one, the only!

spellbyte

as i said the file im trying to include is calling on a different server, have you a suggestion as to how can i resolve this

Thurnok

There are a number of issues here you need to be aware of.  First, Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via include.

Second, you have to make sure your PHP.INI file contains:
allow_url_fopen = 1
Which means you must be able to change the PHP.INI file.  Ok, if it is your own server, not going to happen if you have a host provider.

Third, the server that you are trying to "include" the file from will not simply give you the file as it sits on the server, unless that server does not run php files (going from your example of banner.php) through the php processor.  Instead, what would happen is the external server would "process" the "banner.php" file over there through the php processor on the external server and give you the "result" of that, not the actual file.  If you want the actual "file" then you have to turn off the php processor for .php files, or rename the file to something like "banner.php.txt".
Thurnok
The one, the only!

spellbyte

ok thanks for that, looks like i'll have to stick with Iframes

This website is proudly hosted on Crocweb Cloud Website Hosting.