tags:

views:

33

answers:

2

Example client put this on their website

<script type="text/javascript" src="http://domain.com/banner.php?bid=123&amp;affid=88"&gt;&lt;/script&gt;

In my banner.php how do I implement it?

I try to get the banner id & affid using $_GET but it's not working..

Let me know the clue how to display the banner on my client site using this way.

my banner.php

<?php
define('X', true);
include_once('includes/connection.php');

$banner_id = intval($_GET['bid']);
$aff_id = intval($_GET['affid']);

$select = 'SELECT images FROM affbanners WHERE id='.$banner_id;
$query  = $db->rq($select);
$display = $db->fetch($query);

?> 

 <a href="http://domain.com/aff?id=&lt;?php echo $aff_id; ?>"><img src="http://domain.com/images/&lt;?php echo $display['images']; ?>" height="250" width="250" /></a>

I dunno how to make it work actually.

A: 

What you have done is:

<script type="text/javascript" src="http://domain.com/banner.php?bid=123&amp;affid=88"&gt;&lt;/script&gt;

So the script at banner.php should send a javascript: so enclose your output in `document.write method i.e.

document.write('<a href="http://domain.com/aff?id=&lt;?php echo $aff_id; ?>"><img src="http://domain.com/images/&lt;?php echo $display["image"]; ?>" height="250" width="250" /></a>');

and send and set the header in php like:

header("Content-type: text/javascript"); 
Aman Kumar Jain
ok question update
delicious
thanks bro.. it's worked now
delicious
A: 
<?php echo $display['image']; ?>

Should be

<?php echo $display['images']; ?>
Leon