Forum Moderators: phranque

Message Too Old, No Replies

Show PHP generated banner in HTML

         

Jakotsu

1:18 am on May 13, 2005 (gmt 0)

10+ Year Member



Hi,

I have a banner created using PHP and a CSS script.

<SNIP>

I am using FrontPage and I need to include such banner in the current HTML pages from my site, but I sincerely have no idea on how to proceed. I assume I have to create a frame like the one used by Google's ADSense ads, but I don't know how to do it.

Any help will be greatly appreciated.

[edited by: trillianjedi at 7:57 am (utc) on May 13, 2005]
[edit reason] No URL's please - see TOS [/edit]

kazecoder

10:29 am on May 13, 2005 (gmt 0)

10+ Year Member



Lets see some code. My initial thought is if its written in php then rename your page to a .php extension if its not already and do a include where ever you want the banner to show up.

<?php include("codeforbanner.php");?>

henry0

10:49 am on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also in most case you may have the HTML files parsed by PHP
By changing your HTTPD. Conf or creating a .htaccess file
To include:
<FilesMatch "\.html$" >
ForceType application/x-httpd-php
</FilesMatch>

A word of caution as per another post from hakre (WebmasterWorld member)


The type ("application/x-httpd-php") can differ on various setups. you can find the correct type in httpd.conf or ask your administrator for it.

encyclo

2:10 pm on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firstly, if you want to go down the .htaccess route, it is better to use an AddHandler rather than FilesMatch and ForceType:

AddHandler application/x-httpd-php .html

However this approach may well be overkill for your situation. When you say a "banner", do you mean a advertisement graphic? If so, then you should just use an iframe (inline frame) to display it. Something like:

<iframe src="mybanner.php" width="468" height="60"></iframe>

Then you are just calling a file called "mybanner.php" which is the only one that needs to be parsed for PHP.

Jakotsu

12:35 am on May 14, 2005 (gmt 0)

10+ Year Member



Thanks, the iframe works perfectly. But for some reason its background is not transparent udner IE6 while it is under FireFox 104, the code Im using is:

<iframe align="center" src="xml_728x90.php" width="732" height="92" allowTransparency="true" frameBorder="0" scrolling="no" marginwidth="1" marginheight="1" name="mlad"></iframe></p>

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

[edited by: tedster at 5:22 am (utc) on May 14, 2005]

Jakotsu

3:49 am on May 14, 2005 (gmt 0)

10+ Year Member



Well thanks everyone, I fixed it by using a white background and setting up the frame from FrontPage itself, it works great now.

:)

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

[edited by: tedster at 5:23 am (utc) on May 14, 2005]