Implementing a PHP Script in a website (FAO DT)

Right I’ve got the follwoing code…

if(!function_exists('btb_banner_script'))
{
function btb_banner_script()
{
if(!isset($_SERVER['REMOTE_ADDR'])) $btb_server_ip = '-';
else $btb_server_ip = urlencode($_SERVER['REMOTE_ADDR']);
if(!isset($_SERVER['SERVER_NAME'])) $btb_server_name = '-';
else $btb_server_name = urlencode($_SERVER['SERVER_NAME']);
if(!isset($_SERVER['REQUEST_URI'])) $btb_uri = '-';
else $btb_uri = urlencode($_SERVER['REQUEST_URI']);
if(!isset($_SERVER['HTTP_USER_AGENT'])) $btb_ua = '-';
else $btb_ua = urlencode($_SERVER['HTTP_USER_AGENT']);

	if(!$fp = fopen('http://www.betterthanbanners.com/adserver.php?pubid=761&template=1&ip='.$btb_server_ip.'&uri='.$btb_server_name.$btb_uri.'&ua='.$btb_ua,'r')) echo ' ';
	else
	{
	echo ' ';
 		while(!feof($fp)) echo fgets($fp);
	fclose($fp);
	}
}
btb_banner_script();
}

And I want to put it onto my site (yes…banner advertising…:rolleyes:

Do I put it in a file with .php extension and link the file or what?

(Aimed at you DT because I know you sent me this better banner’s link:p )

take the easier option and just use html code :lol:

Login to the betterthanbanners site and there is an option somewhere for non-server side include code.


<table width=468 height="60" align="center" cellpadding="0" cellspacing="0" background="http://www.bestdealinsurance.co.uk/images/BANNERBACK3.jpg"  style=" border: solid 1px #999999;FONT-SIZE: 9pt; FONT-FAMILY: Arial; color:#666666; text-decoration:none;">
<tr>
<td width="97" rowspan=2 valign="bottom"><div align="center"> </div></td>
</tr>
<tr>
<td width="369" align="center" >
<table width="100%"  border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2" align="center"><a href="http://www.bestdealinsurance.co.uk/" style="text-decoration:none" title="ONLINE LIFE INSURANCE QUOTES"><strong><font color="#000000">PROTECT YOUR FAMILY  <img src="http://www.bestdealinsurance.co.uk/images/getquote.gif" width="9" height="10" border="0">  GET QUOTE</font></strong></a>
</td>
</tr>
<tr>
<td width="41%" align="center" valign="top"><a  style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; color:#545454; text-decoration:none;" title="critical illness insurance" href="http://www.bestdealinsurance.co.uk/basicinfoci.asp">critical illness insurance</a><br>
<a  style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; color:#545454; text-decoration:none;" title="term insurance" href="http://www.bestdealinsurance.co.uk/about.htm">term insurance</a>
</td>
<td width="59%" align="center" valign="top"><a  style="FONT-SIZE: 8pt; FONT-FAMILY: Arial; color:#545454; text-decoration:none;" title="visit now" href="http://www.bestdealinsurance.co.uk/">visit now</a><br>

</td>
</tr>
      </table>
</td>
</tr>
</table>

Just in case you can’t get in - I get a script error trying to retrieve just the html at the moment, login then click retrieve my code, click the html option, click your domain and it should give you the html.

DT.

Was really wanting non static images put hey…it works