![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jun 2007
Posts: 9
Rep Power: 0
![]() |
Hello all,
Can someone tell me how to use an adrotator in php. In asp you can use <asp:adrotator:............................. /> I need to do the same in php. Please help. Thanks all. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Adrotator
You could make one very easily yourself. In fact, it's already been done. http://www.phpbuddy.com/article.php?id=4
If it doesn't fit your needs, just modify/extend it. Or search "php adrotater" on Google. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jun 2007
Posts: 9
Rep Power: 0
![]() |
Re: Adrotator
Thanks alot Sane.
I have tried but for some reasons its not working. Last edited by kinuthia; Jan 30th, 2008 at 6:40 PM. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Adrotator
Could you post the code? What exactly is the problem?
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Jun 2007
Posts: 9
Rep Power: 0
![]() |
Re: Adrotator
Thanks Sane. I think the code is okey. I tested it in a different page and it works okey. The thing is i'm trying to use it in a templated website and that is where its not working. I think i have to create another function to handle this. I honestly don't know how to do it but im still trying to look for ways. Im not an expert in PHP but just started to learn it a month ago.
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Adrotator
You could wrap the code I linked to, into a function, and save it as a separate PHP script.
adrotater.php PHP Syntax (Toggle Plain Text)
Place the above file, adrotater.php, in the same directory as your other scripts. This would allow you to use the function, in your main PHP file, like so: index.php PHP Syntax (Toggle Plain Text)
Make sure to include the adrotater.php file in every file you want to use the adrotater function. Then the argument passed to it, 'banner_ads.txt', is the text file with the advertisements inside. |
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Re: Adrotator
Does PHP's
rand function return numbers uniformly? If it doesn't, it's probably a poor choice for this sort of thing.As an aside, it's spelt "rotator." No offence, Sane. ![]() |
|
|
|
|
|
#8 |
|
Newbie
Join Date: Jun 2007
Posts: 9
Rep Power: 0
![]() |
Re: Adrotator
Ooble
Any alternatives. |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Jun 2007
Posts: 9
Rep Power: 0
![]() |
Re: Adrotator
Sane
Im still trying to figure this out. I have to incorperate the function in other functions list where it will be called from. |
|
|
|
|
|
#10 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Adrotator
It would return it uniformly enough. Anything random would be good enough for an adrotator.
And wow, I had no clue I was spelling that incorrectly. Thanks for the correction. ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|