Can anyjone tell the simplies way to add captcha...
I've tried by watching that on other scripts, but i cant make my own... 🙁
Please explain the process, it will be very good if also can add some previews... 🙁
Started on the old forum in April 2010 · view the original in the archive · old links redirect here
Can anyjone tell the simplies way to add captcha...
I've tried by watching that on other scripts, but i cant make my own... 🙁
Please explain the process, it will be very good if also can add some previews... 🙁
Save this as captcha.php
<?php
header('content-type: image/jpeg');
$height = 25;
$width = 55;
$image_p = imagecreate($width,$height);
$black = imagecolorallocate($image_p,0,0,0);
$white = imagecolorallocate($image_p,255,255,255);
$font_size = 14;
imagestring($image_p,$font_size,5,5,"".$_GET['text']."",$white);
imagejpeg($image_p,null,80);
?>
then in ur register form
$text = rand(11111,99999);
$rform .= "Image Verification\n<br/>\n<img src=\"captcha.php?text=$text\" alt=\"captcha\"/> = <input type=\"text\" format=\"*n\" name=\"ucans\" maxlength=\"5\" size=\"2\"/><br/>\n";
$rform .= "<input type=\"hidden\" name=\"rcans\" value=\"$text\"/>\n";
and in your register.php
$ucans = $_POST["ucans"];
$rcans = $_POST["rcans"];
if($ucans!=$rcans) echo "Wrong Image Verification!";
try diz..i just typed it now..don't know if it'll work and if u understand..just analyze..
My Blog: http://jhommark.blogspot.com My Facebook: http://www.facebook.com/jhommark My Official Site: http://www.undergroundweb.tk My Community Site: http://undergroundwap.xtreemhost.com
Demo: Registration | UnderGroundWAP and captcha http://undergroundwap.co.cc/captcha.php?numOne=1&numTwo=2 param val of numOne is 1 and numTwo is 2..Their sum should be 3..this is different from what i've previously posted coz i use sum of 2 numbers and i just use random numbers in my post here..
My Blog: http://jhommark.blogspot.com My Facebook: http://www.facebook.com/jhommark My Official Site: http://www.undergroundweb.tk My Community Site: http://undergroundwap.xtreemhost.com
kiLLeR-eyEd_14 wrote: Demo: Registration | UnderGroundWAP and captcha http://undergroundwap.co.cc/captcha.php?numOne=1&numTwo=2 param val of numOne is 1 and numTwo is 2..Their sum should be 3..this is different from what i've previously posted coz i use sum of 2 numbers and i just use random numbers in my post here..
where is the code of captcha.Php?
Try my captcha.php better
<?php
session_id("".$_GET['sid']."");
session_start();
$string=rand(1000,10000);
$_SESSION['ref'] = $string;
Header("Content-type: image/gif");
$im = ImageCreateFromGif("img.gif");
$orange = ImageColorAllocate($im, 0, 0, 0);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageString($im,3,$px,1,$string,$orange);
ImageGif($im);
ImageDestroy($im);
?>
I dont know why, yours not workin for me..
O.K i've found anauther way, btw thanx for previews, now i understand how "stuff" works.
O.K My preview:
Post it at Your input field
echo "*Security code:<br/>\n";
$r1=rand(0,100); $r2=rand(0,100); $r3=rand(0,100); $rand="$r1$r2$r3";
echo "<small><b>$rand</b></small><br/>\n";
echo "<input name=\"code\" maxlength=\"9\" title=\"infa\" emptyok=\"false\"/><br/>\n";
On postfield field place this:
<postfield name=\"code\" value=\"$(code)\"/>
<postfield name=\"kod\" value=\"$rand\"/>
At the register page place this:
if ($code=="") {
die
(print "Enter security code!<br/>
</small></p></card></wml>");
}
if ($code !== $kod) {
die
(print "Wrong security code!<br/>
</small></p></card></wml>");
}
Hope this helps someone 😉
P.S that works on wml, on html have probs
That's also what i have before but i removed the session thing coz other mobile doesn't support session or cookies..i think of how i could make it work w/o using cookies to store the captcha..So i think, my idea is better..
My Blog: http://jhommark.blogspot.com My Facebook: http://www.facebook.com/jhommark My Official Site: http://www.undergroundweb.tk My Community Site: http://undergroundwap.xtreemhost.com
If u're gonna make it in html, u should use <form><input>
My Blog: http://jhommark.blogspot.com My Facebook: http://www.facebook.com/jhommark My Official Site: http://www.undergroundweb.tk My Community Site: http://undergroundwap.xtreemhost.com