| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | {Wanted} Random ad's script I need a random ads script i dont want the script like i have to upload and banner and stuff i want it so i just put in the html (like google codes and clicksor codes ect) and it will show it on my homepage ect. |
| |
| | #4 (permalink) |
| Senior Member Join Date: Aug 2005 Location: United Kindom
Posts: 1,502
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I have made you one: Code: <?php
srand( microtime() * 1000000);
$advertise = rand(1,3);
//After the rand decided how many youve got and the first and last number e.g got 3, 1,3
switch($advertise)
//you can add more just use the same format
{
case 1 : $banner="site 1 image url"; $url="site one address"; break;
case 2 : $banner="site 2 image url"; $url="site two address"; break;
case 3 : $banner="site 3 image url"; $url="site 3 address"; break;
}
$display = "<a href=\"$url\" target=\"_blank\"> ";
$display.= "<img src=\"$banner\" ";
$display.= "width=\"468\" height=\"60\" border=\"0\" >";
$display.="</a>";
echo($display);
?> |
| |
| | #5 (permalink) |
| NamePros Legend Join Date: Dec 2005 Location: Philippines - www.Nabaza.com
Posts: 19,785
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | try this: http://phpadsnew.com/two/ you can just copy and paste any html code for the ad and it will rotate. |
| |
| | #6 (permalink) | ||||
| Senior Member Join Date: Sep 2005 Location: NC
Posts: 2,323
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
i like it, Simple script.
__________________ Sharing 50% profit for helping to sell on ebay. PM me for more info. | ||||
| |
| | #7 (permalink) |
| NamePros Regular Join Date: Oct 2005 Location: Milford MA
Posts: 692
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I prefer flatDB for this. In your DB file, put: Code: http://www.hi.com||http://www.hi.com/hi.png http://www.hi2.com||http://www.hi2.com/hi.png PHP Code: |
| |
| | #8 (permalink) |
| Resistance is Futile Join Date: Apr 2006 Location: Montreal, Canada
Posts: 1,094
![]() ![]() ![]() ![]() ![]() ![]() | You can use this code in the area you want the ad: PHP Code: ????: NamePros.com http://www.namepros.com/showthread.php?t=154470 In that text document include the following text. Code: YOUR FIRST AD CODE ~ YOUR SECOND AD CODE ~ YOUR THIRD AD CODE ~ etc.....
__________________ Freelance Web Developer PHP, MySQL, XHTML, CSS, Javascript, jQuery, Wordpress Portfolio: www.bundy.ca
Last edited by Kadenz; 04-06-2006 at 04:30 PM.
|
| |
| | #10 (permalink) |
| Resistance is Futile Join Date: Apr 2006 Location: Montreal, Canada
Posts: 1,094
![]() ![]() ![]() ![]() ![]() ![]() | I don't really care who uses this code. Can't find out anyways it's in PHP!
__________________ Freelance Web Developer PHP, MySQL, XHTML, CSS, Javascript, jQuery, Wordpress Portfolio: www.bundy.ca |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wanted - Web Hosting Directory Script. | senaia | Website Development | 3 | 12-03-2005 07:27 AM |
| Part time PHP script installer and customer service rep wanted (offer closed) | RJ | Scripts For Sale | 2 | 05-07-2005 01:33 AM |
| coder wanted for name script | ypn | Website Development | 2 | 10-09-2003 03:04 PM |