 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
10-21-2008, 10:17 PM
|
#1 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
why do i get error on this ?
PHP Code:
<?php session_start(); //imagecreatefrompng :: create a new image //from file or URL $img = imagecreatefrompng('black.png'); //displaying the random text on the captcha $numero = rand(100, 999); $_SESSION['check'] = $numero; //The function imagecolorallocate creates a //color using RGB (red,green,blue) format. $white = imagecolorallocate($img, 255, 255, 255); imagestring($img, 10, 8, 3, $numero, $white); header ("Content-type: image/png"); imagepng($img); ?>
and then in the reg page
you do this
session_start();
PHP Code:
if(($_POST['check']) == $_SESSION['check']) { echo 'Input OK'; }else{ echo 'Input Wrong'; }
but i get..
echo 'Input Wrong';
|
|
|
|
10-21-2008, 10:31 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
|
on $_SESSION['check'] = ($numero);
whats with the () around $numero?
Not sure if thats an error but I could see it as one. What is the actualy error statement.
|
|
|
|
10-21-2008, 10:34 PM
|
#3 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
the form
Code:
<form method="POST" action="register.php">
<img src="captchas.php"> <br>
<input type="text" size="10" name="check">
<input type="submit" name="submit" value="submit">
</form>
|
|
|
|
10-21-2008, 10:36 PM
|
#4 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
it wont, accept it, if it did it would not turn in to echo 'Input Wrong';..
|
|
|
|
10-21-2008, 11:48 PM
|
#5 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
is there anyone that knows a better way to create.
a CAPTCHA with PHP ?
|
|
|
|
10-22-2008, 07:07 AM
|
#6 (permalink)
|
|
The Contributor
Join Date: Oct 2008
Location: Nuremberg, Germany
Posts: 26
Thanks: 3
|
Just try the PEAR package Text_CAPTCHA.
Greetings,
Alex
|
|
|
|
The Following User Says Thank You to awuehr For This Useful Post:
|
|
10-22-2008, 07:21 AM
|
#7 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Hehe persistant are we? 
__________________
|
|
|
|
10-22-2008, 05:04 PM
|
#8 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
"persistent"
|
|
|
|
10-22-2008, 07:30 PM
|
#9 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Don't make me get all particular with spellings, syntaxes, punctuation, et cetera...!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
10-22-2008, 07:37 PM
|
#10 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Don't make Wildhoney get all particular with spelling, syntax, punctuation, et cetera!
|
|
|
|
10-22-2008, 09:01 PM
|
#11 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Touché! Touché!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
10-23-2008, 12:00 AM
|
#12 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
i made a test / for bot users /
i did like this, simple.
$bottest = $_POST['leave_blank'];
if(strlen($bottest)>1)
{
echo "Nice try!";
}
"<div style='display:none;visibility:hidden;'>",
"<input type='text' name='leave_blank' id='leave_blank'>",
"</div>",
Don't know if that works out to be a good thing for this..
what do you think ?
|
|
|
|
10-23-2008, 12:44 AM
|
#13 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Yes, that's one of the simplest ways to do it. Although being simple, it is quite easy to identify. Nonetheless, I would say it'll prevent a good portion of them.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
10-23-2008, 12:49 AM
|
#14 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
so i did something good :P
yeah awesome xD
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|