I'm trying to make an image captcha from scratch for a small project, but in the code below, I can't seem to manage to run the upRAns() function, I can't find the proper syntax anywhere. Any help?
for($i = 0; $i < 9; $i++){
$j = rand(1, 4);
echo '<img src="images/' . $j . '.png" height = 150 width = 150 class = captcha onclick = "captchaClick(this)" data-target=' . $i . '/>';
echo '<input type=checkbox class=hidden name=' . $i . '/>';
if(($i+1)%3 == 0){
echo '<br>';
}
if($j == $ans){
echo '<script src = "Captcha.js">upRAns(' . $i . ')</script>'; //this line right here
}
}