Banner Manager

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vani sri
Forum Commoner
Posts: 28
Joined: Fri Apr 25, 2008 12:20 am

Banner Manager

Post by vani sri »

Hi all,

I am working in banner manager project. If i upload the image in site 1 means that image view on site 2 . On click of this image it redirect to site3 & need to update the DB in site1.

How i update Db in site 1

Thanks & regards,
vani
nowaydown1
Forum Contributor
Posts: 169
Joined: Sun Apr 27, 2008 1:22 am

Re: Banner Manager

Post by nowaydown1 »

Vani,

One way you could accomplish this would be to point your hyperlinks on any banner you are displaying to a script that resides on server1. So for example, the html markup for your banner might look like:

Code: Select all

 
<a href="http://www.exampleserver1.com/redirect.php?bannerID=47473"><img src="banner_image.jpg" /></a>
 
When the user clicks on your displayed banner, your script (redirect.php) on server 1 would do two things. It would look up the bannerID you provided in the database and do whatever updating needs to be done for that record (I assume you're trying to update number of click-throughs or something). Then, you would query the database using that same bannerID to figure out where you should directing the user to (the web address of server3).

So the request cycle would be something like:
-User clicks on banner and is redirected to exampleserver1.com/redirect.php?bannerID=47473
-Redirect script answers and does your database updates.
-Redirect script queries the database and finds the client web address for this banner is http://www.exampleserver3.com
-Then your redirect.php script would spit out a location http header with the web address (exampleserver3.com) which will redirect them there.

From the user facing side, they click the banner and wind up at exampleserver3.com and don't really realize they were ever directed off to server #1.

Hope that helps.
vani sri
Forum Commoner
Posts: 28
Joined: Fri Apr 25, 2008 12:20 am

Re: Banner Manager

Post by vani sri »

Hi nowaydown1,

Thanks for reply. It's really very helpful to me.
Post Reply