jayveezed Posted June 12, 2009 Share Posted June 12, 2009 Hi there I have set up a mysql database for a pretty basic random quote generator (the php code I used is from here http://www.weberdev.com/get_example-1630.html ) I want a random code generator whereby a user can click a button and a new (random) quote is generated without refreshing the whole window. If this makes no sense here is a javascript version of the sort of thing I want to do... http://www.hscripts.com/scripts/JavaScript/random-quote-generator.php ...... I just need to know how to call the script with a button of some sort. Any help would be most appreciated... cheers Jay Link to comment https://forums.phpfreaks.com/topic/161896-create-button-to-call-a-random-quote/ Share on other sites More sharing options...
PugJr Posted June 12, 2009 Share Posted June 12, 2009 PHP won't be of any use if you want it to call from the DB without refreshing the page. Javascript probably would be your best choice to do that, assuming you do not want the page to be refreshed. Link to comment https://forums.phpfreaks.com/topic/161896-create-button-to-call-a-random-quote/#findComment-854188 Share on other sites More sharing options...
haku Posted June 12, 2009 Share Posted June 12, 2009 javascript/ajax is the only way to do this. Link to comment https://forums.phpfreaks.com/topic/161896-create-button-to-call-a-random-quote/#findComment-854198 Share on other sites More sharing options...
jayveezed Posted June 12, 2009 Author Share Posted June 12, 2009 Thanks for the info, at least I know how to set up a database now (!) and you've saved me a lot of fruitless searching around. cheers again jay Link to comment https://forums.phpfreaks.com/topic/161896-create-button-to-call-a-random-quote/#findComment-854315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.