if(document.form1.captcha.value != <?php echo json_encode($code) ?>){
        alert("qq. \n");
        return false;
    }   

whats wrong with my code? syntax error

missing quotes aroud the php echo i think

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.