I have a page in which I publish articles and allow visitors to put in their comments.
I have put image "verification number" which generates random image and the visitor needs to key in the correct verification code to submit his comment.
Page works fine and checks for matching "verification number" after submitting the page.
But I want to validate this "verification number" before submitting the page.
Only glitch is the value of "verification number" which is stored in session variable always has the previous value in its state
This is causing all user inputs to fail.
How do i retrieve the latest "verification number" from session variable?
document.getElementById('xnum').value='<?php echo $_SESSION['random_value'];?>';
Validation Code:<input name='numcode' id='numcodex' type='text' class='input' width='90px'> <=> <img src='randomimage.php' onclick=\"assignval();\">
Test:<input type='text' name='xnum1' id='xnum' class='input' style='width:230px'>
randomimage.php generates "Verification number"
function assignval() assigns the value of "verification number" from session variable 'random_value' to dummy field xnum1
What is happening is on 1st try it is blank
then i refresh page and click on image, then the previous value of "verification number" is assigned to xnum1
i.e., xnum1 is assigned the value of previous "verification number"
How to fix this...
Call friends with PC-to-PC calling -- FREE
[Non-text portions of this message have been removed]