News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Problem With PHP Includes

Started by SKETCHi, June 02, 2005, 02:39:12 PM

Previous topic - Next topic

SKETCHi

Alright, I recently set-up a script for affiliate (88x31) button rotation. The problem is, when I attempt to place the include in index.template.php, either nothing shows up or it gives an error.

I've tried:

<?php include "http://www.graphicaddicts.net/toplists/affiliates.php" ?>

and

<? @include ("http://www.graphicaddicts.net/toplists/affiliates.php"); ?>


Neither worked... The first one gave me an error, the second one loads but does not show the 88x31's.

Thantos

the @ infront of the include supresses any errors or warnings.  What error message are you getting?

[Unknown]

Does the PHP script output image data?  If so, including it is not going to work.

And, if not, doing it by URL is bad.

-[Unknown]

SKETCHi

I tried without the @ and received the same result.

The first code I tried works with the other pages on my website, which I made myself.

I know very little about the script, and php in general for that matter. I basically copy/pasted it from a tutorial. It uses an SQL database to store the affiliate buttons and links and such. Here is a link to the tutorial. http://www.forums.pixel-designz.net/index.php?showtopic=781

I just need to know how to word the include to make it work. I searched "PHP Includes" and thats where I got the second code, from one of the results.

So, how can I get it to work?

[Unknown]

Are you doing this in a template?  If so, you want:

';

include("http://www.graphicaddicts.net/toplists/affiliates.php");

echo '


Still, doing it by URL is inefficient...

-[Unknown]


Advertisement: