It looks like you're new here. If you want to get involved, click one of these buttons!
I want to create form captcha using php and java script
Use this code <?php $code=rand(1000,9999); ?> <-script start-> function myfun(){ var x = document.getElementById('captcha1').value; var y = <?php echo $code ?>; if (x == y) { return true; } else{ return false; } } <-script end-> <-form-> <-span-><?php echo $code;?><-/span-> <-input id="captcha1" name="captcha" type="text"> <-input id="button" type='submit' onclick=" return myfun();" value='Submit'> <-/form->
Comments