Jump to content

jQuery to refresh PHP variable


otester

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/211290-jquery-to-refresh-php-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.