apaunganhote Posted March 23, 2008 Share Posted March 23, 2008 Hello all, Sorry for my noob again. I want to get captcha image in my registration form and I tried to search captcha. I found that Secure Image captcha suit with my needs. I tried to install it and look their example form. But I didn't get like what i want. Because they didn't give us like that they shown in their demo. I want to get like this demo exactly. http://www.phpcaptcha.org/try-securimage/ In their example php, it's give like that, please kindly see the screen shot, In the second picture, it showing validating message, but when the validation message show, Image Verification and forms are disappear. I want to get like one is like, the example they show, please kindly see the screen shot. In the second picture of their example, validate message is shown upon and forms are not disappear. The one I want is exactly like that one. Can anyone help me out ? Please kindly help to me. This is the example_form.php code, that give it in package. <html> <head> <title>Securimage Test Form</title> </head> <body> <?php if (empty($_POST)) { ?> <form method="POST"> Username:<br /> <input type="text" name="username" /><br /> Password:<br /> <input type="text" name="password" /><br /> <!-- pass a session id to the query string of the script to prevent ie caching --> <img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br /> <input type="text" name="code" /><br /> <input type="submit" value="Submit Form" /> </form> <?php } else { //form is posted include("securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == true) { echo "<center>Thanks, you entered the correct code.</center>"; } else { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } } ?> </body> </html> Thanks. Please help me. Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/ Share on other sites More sharing options...
apaunganhote Posted March 23, 2008 Author Share Posted March 23, 2008 anyone help ? I am desperate now :'( Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-498811 Share on other sites More sharing options...
apaunganhote Posted March 24, 2008 Author Share Posted March 24, 2008 sry, bump. Can anyone help me ? Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499092 Share on other sites More sharing options...
MadTechie Posted March 24, 2008 Share Posted March 24, 2008 try this quick example <html> <head> <title>Securimage Test Form</title> </head> <body> <?php //if (empty($_POST)) { //Remove ?> <form method="POST"> Username:<br /> <input type="text" name="username" /><br /> Password:<br /> <input type="text" name="password" /><br /> <!-- pass a session id to the query string of the script to prevent ie caching --> <img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br /> <input type="text" name="code" /><br /> <input type="submit" value="Submit Form" /> </form> <?php // } else { //form is posted //remove include("securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == true) { echo "<center>Thanks, you entered the correct code.</center>"; } else { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499098 Share on other sites More sharing options...
apaunganhote Posted March 24, 2008 Author Share Posted March 24, 2008 Thanks for the quick example Got this error Parse error: syntax error, unexpected '}' in C:\local\www\captcha\secureimage\example_form.php on line 34 Please kindly check it again for me. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499144 Share on other sites More sharing options...
MadTechie Posted March 24, 2008 Share Posted March 24, 2008 oops comment out the last } } else { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } //} //REMOVE Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499146 Share on other sites More sharing options...
apaunganhote Posted March 24, 2008 Author Share Posted March 24, 2008 Yes, Thanks. IT removed the error. But, validation message comes when i start browsing. I didn't press the submit form yet. Please kindly see this screenshot. Please kindly check it for me. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499162 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 try <html> <head> <title>Securimage Test Form</title> </head> <body> <?php if (empty($_POST)){ ?> <form method="POST"> Username:<br /> <input type="text" name="username" /><br /> Password:<br /> <input type="text" name="password" /><br /> <!-- pass a session id to the query string of the script to prevent ie caching --> <img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br /> <input type="text" name="code" /><br /> <input type="submit" value="Submit Form" /> </form> <?php } else { / include("securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == true) { echo "<center>Thanks, you entered the correct code.</center>"; } else { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499165 Share on other sites More sharing options...
apaunganhote Posted March 24, 2008 Author Share Posted March 24, 2008 Hello, I think that is probably same with what they gave it in sample. That i paste code here at the very fist post. I want the one about validating message is within in one page, like , when i click submit, it will show the validation message at the top and not disabling the form. Please kindly check the example here. I want exactly like that one. http://www.phpcaptcha.org/try-securimage/ Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499174 Share on other sites More sharing options...
MadTechie Posted March 24, 2008 Share Posted March 24, 2008 Okay fine try this.. <html> <head> <title>Securimage Test Form</title> </head> <body> <?php if (!empty($_POST)){ //form is posted include("securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == true) { echo "<center>Thanks, you entered the correct code.</center>"; } else { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } } ?> <form method="POST"> Username:<br /> <input type="text" name="username" /><br /> Password:<br /> <input type="text" name="password" /><br /> <!-- pass a session id to the query string of the script to prevent ie caching --> <img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br /> <input type="text" name="code" /><br /> <input type="submit" value="Submit Form" /> </form> </body> </html> you should beable to update the text colour but this is pretty basic stuff, and should be posted in third party section Quote Link to comment https://forums.phpfreaks.com/topic/97478-secure-image-captcha-installation-please-help/#findComment-499297 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.