حالا همینی که میخوای رو میذارم میل خودته این کد رو بذار داخل captcha.php
$captchaText = mt_rand(10000000, 99999999);echo $captchaText;
این هم فایل اصلیت که میخوای کپچا توش نمایش داده بشه
کد HTML:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><head><title>captcha</title></head><script>function loadcap(){ $.ajax({ url:'captcha.php', success: function(data) { $("#divid").html(data); } });}</script><body><div style="cursor:pointer;" onclick="loadcap();">refresh</div><div class="header" id="divid"><script>loadcap();</script></div></body>