Guber-X Posted December 21, 2011 Share Posted December 21, 2011 this is one thing im pretty stumped on, i have done searches and tried a few different banner rotators, but they all rotate on page reload. im looking for time based rotator that doesnt require a page reload. as far as it goes, i have nothing thats working the way im looking for. I have a database table called "featurebox" and the colums are "id", "imgsrc", "imgurl". the other tough part is that i need it to switch with a background image of a table. my layout for this would not work if it was just a image in a table :/ I have a rotator working for it at this moment. but its in java, and i want to get rid of the java cuz it dont work to well with php or at least not well for me. this is the page that im working on. www.fightingforyesterday.com/index.php that spot where u see some images changes in the box where "feature" is titled. thats just java and they have no links to click on. and i want to change it so each image has its own URL to goto. it is the same idea as a banner rotator, but of course its not for ads to other sites. i dont really have any code that would be usefull to show you to help out. but if you want to see something just let me know Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/ Share on other sites More sharing options...
Samuz Posted December 21, 2011 Share Posted December 21, 2011 "im looking for time based rotator that doesnt require a page reload." Sounds like you may want to look into ajax a bit. Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/#findComment-1300255 Share on other sites More sharing options...
Guber-X Posted December 21, 2011 Author Share Posted December 21, 2011 i have no idea what ajax is... lol Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/#findComment-1300260 Share on other sites More sharing options...
xProteuSx Posted December 22, 2011 Share Posted December 22, 2011 AJAX is a mix of JavaScript and PHP. Essentially, JavaScript can execute without a page reload. So you use a JavaScript command to trigger a PHP script which, most often, generates a XML file. The JavaScript can then retrieve the XML file, parse it, and update an element of the page, such as a div. Your work flow would be something like this (assuming that a new ad appears every 30 seconds): User loads page -> start JavaScript timer -> at 30 seconds trigger a php page which retrieves another ad from a database and creates an XML file -> use JavaScript to parse the XML file -> use JavaScript to retrieve values necessary to display new ad, such as a new link and new image or text -> use JavaScript to update the div in which the ad is displayed -> reset timer to 0 I used to be a fan of AJAX, until I realized that AJAX is not supported by Safari or Chrome. Maybe there's a way around this, but I don't know of any yet ... Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/#findComment-1300405 Share on other sites More sharing options...
harristweed Posted December 22, 2011 Share Posted December 22, 2011 Have a look at: http://www.alohatechsupport.net/webdesignmaui/maui-web-site-design/easy_jquery_auto_image_rotator.html Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/#findComment-1300410 Share on other sites More sharing options...
Tate Posted December 22, 2011 Share Posted December 22, 2011 Super easy intro into AJAX Intact its how I started getting interested. Basically do server side actions with no page load! what more could you want! Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/#findComment-1300425 Share on other sites More sharing options...
xProteuSx Posted December 22, 2011 Share Posted December 22, 2011 I would like some hot concubines ... Quote Link to comment https://forums.phpfreaks.com/topic/253635-banner-rotator-from-database/#findComment-1300625 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.