roger01 Posted December 11, 2016 Share Posted December 11, 2016 Hello So i have 0 knowledge in php, i just need to implement this captcha: i have a webserver php file which contains: $content .= "<some html code>"; i have the captcha code which looks like this: if (!class_exists('KeyCAPTCHA_CLASS')) { include('keycaptcha.php'); } $kc_o = new KeyCAPTCHA_CLASS(); echo $kc_o->render_js(); so far, the only way i've managed to make it display the captcha on the page is by doing this: $content .= "<first part of html code>"; if (!class_exists('KeyCAPTCHA_CLASS')) { include('keycaptcha.php'); } $kc_o = new KeyCAPTCHA_CLASS(); echo $kc_o->render_js(); $content .= "<second part of html code>"; now, the problem is, the captcha isn't displayed where the html code is, but as the first thing on the page, in the upper left corner. any idea how to make it display inside the html code? the html code is actually a <form> thank you! Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted December 11, 2016 Share Posted December 11, 2016 The string returned by KeyCAPTCHA_CLASS::render_js() must be inserted into the form at the exact location where you want the CAPTCHA. This would be a lot easier if you (or the code author) had properly separated the HTML markup from the PHP code. Now you need to split your HTML string to inject the CAPTCHA snippet: $content = '<other elements><form><prior input elements>'.$kc_o->render_js().'<next input elements></form><other elements>'; In the long run, however, you'll need an actual programmer to fix the mess. Quote Link to comment Share on other sites More sharing options...
roger01 Posted December 11, 2016 Author Share Posted December 11, 2016 thank you. using ' would display (), but it worked with " " thank you again been struggling with this for a few hours now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.