otester Posted August 20, 2010 Share Posted August 20, 2010 I have a PHP random number generator, however this requires page loads to generate another number. If I put the PHP code in a script file, how can I get a button to refresh/update it with an jQuery/Ajax http request? PHP code: <?php $app_ran = Rand(1,6); echo $app_ran; Any help would be great, Thanks, otester Quote Link to comment https://forums.phpfreaks.com/topic/211290-jquery-to-refresh-php-variable/ Share on other sites More sharing options...
otester Posted August 20, 2010 Author Share Posted August 20, 2010 Also this needs to be in PHP as other script rely on it. Quote Link to comment https://forums.phpfreaks.com/topic/211290-jquery-to-refresh-php-variable/#findComment-1101672 Share on other sites More sharing options...
RichardRotterdam Posted August 20, 2010 Share Posted August 20, 2010 Why can't you create a random number with javascript? Quote Link to comment https://forums.phpfreaks.com/topic/211290-jquery-to-refresh-php-variable/#findComment-1101753 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.