CodeClerks

Can someone explain to me how to create a PHP Rotator?



Write the reason you're deleting this FAQ

Can someone explain to me how to create a PHP Rotator?

Could someone please reply below and explain to me how to create a PHP Rotator on my website? I am looking to find out how to create both a Text (with links) Rotator and a Banner (with links) Rotator. It would be great appreciated if someone could help me out here on this thread or create a couple of How-Tos in the PHP Tutorials Forum, then reply below with the link to it. Can someone explain to me how to create a PHP Rotator? Thanks.

Comments

Please login or sign up to leave a comment

Join
Sean101
No, im wanting to find out how to create one, not just use a third party website to make it. Can someone explain to me how to create a PHP Rotator?



Are you sure you want to delete this post?

Write your comment here...
jakemadness
If you wanted to create the banner version in no particular order, you could put the image in a array with a number and a link in the second array with the same number as the image array. example below(no database)

[php]
$banner['images'] = array(
"1" => "http://www.example.com/image-1.png",
"2" => "http://www.example.com/image-2.png",
"3" => "http://www.example.com/image-3.png",
"4" => "http://www.example.com/image-4.png"
);

$banner['links'] = array(
"1" => "http://www.example.com/link-1.html",
"2" => "http://www.example.com/link-2.html",
"3" => "http://www.example.com/link-3.html",
"4" => "http://www.example.com/link-4.html"
);

$num = rand(1, count($banner['links']));

print $banner['images'][$num];//returns banner image
print $banner['links'][$num];//returns banner link

//If you want the image and url in HTML the variable is below.
$banner = "<a href=\"{$banner['links'][$num]}\"><img src=\"{$banner['images'][$num]}\" alt=\"banner\" /></a>";
print $banner;
[/php]
Hope this helps in some way Can someone explain to me how to create a PHP Rotator?



Are you sure you want to delete this post?

Write your comment here...