hi,
again i am new enough to coding!
i want to create a feedback form on my website>
(no real problem there!)
but i am afraid of all these auto mailer programs out there.
i would like to create an extra question like is done on yahoo when you create a new email adress. it asks you to type in the numbers and letters that appear in a picture. is there any easy way of implementing this?
it doesn't have to be incredibly secure any ideas would be appreciated.
verify that the new user is an actual person
Moderator: General Moderators
If you go to the site http://www.hotscripts then you can find some scripts that can do what you seek... Or search google
Remember, google is your friend
Remember, google is your friend
google? what's that??
seriously though, i have used google and hotscripts, but everthing i find is expensive, i would like a free script.
well i was thinking of just creating 10 or so images containing different alphanumberic characters, and if the user inputs any of these it will let the form process? it a bit manual, but i think it will do, the site is not going to be getting that huge amount of hits anyway..
thanks for your reply!
seriously though, i have used google and hotscripts, but everthing i find is expensive, i would like a free script.
well i was thinking of just creating 10 or so images containing different alphanumberic characters, and if the user inputs any of these it will let the form process? it a bit manual, but i think it will do, the site is not going to be getting that huge amount of hits anyway..
thanks for your reply!
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
You will find that here: http://php.resourceindex.com
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
1) Open http://www.google.com
2) Enter what you are looking for - "random number image generator php"
3) Pretty much all the results are what you want. Example:
2) Enter what you are looking for - "random number image generator php"
3) Pretty much all the results are what you want. Example:
Code: Select all
<?php
//random_number.php
$img_number = imagecreate(100,50);
$white = imagecolorallocate($img_number,255,255,255);
$black = imagecolorallocate($img_number,0,0,0);
$grey_shade = imagecolorallocate($img_number,204,204,204);
imagefill($img_number,0,0,$grey_shade);
ImageRectangle($img_number,5,5,94,44,$black);
ImageRectangle($img_number,0,0,99,49,$black);
$number = get_random();
Imagestring($img_number,9,30,15,$number,$black);
header("Content-type: image/jpeg");
imagejpeg($img_number);
function get_random()
{
srand(time());
$max = getrandmax();
return rand(1,$max) + rand(1,$max) ;
}
?>In order for the "Bots" (non-human users) to not be able to read the number out your html source code CANNOT contain the number or any encrypted number... On my websites I usually do the following in this order:
generate validation code for user to enter in
generate a 75 random alpha numeric code used as a unique number
insert the unique number and validation code into the database
put a img src=image.php?code=$unique_id on my form so only the 75 digit unique ID is readable by anyone
then on image.php it gets the unique_id from the query string and looks in the database for the validation code, then prints the validation code out onto the image.... note the only place the validation code shows up is in the image so no script can read it
the only way some one could get the validation code is if they had access to my database
Usually I like to also log signups and if more then 2 people signup within a 5 minute span from the same IP address it will prevent them from signing up by banning them from my website for 10-20 minutes or so, that way even if some one manually decides to spam you by manually typeing in the validation codes I only get spammed several times an hour lol
generate validation code for user to enter in
generate a 75 random alpha numeric code used as a unique number
insert the unique number and validation code into the database
put a img src=image.php?code=$unique_id on my form so only the 75 digit unique ID is readable by anyone
then on image.php it gets the unique_id from the query string and looks in the database for the validation code, then prints the validation code out onto the image.... note the only place the validation code shows up is in the image so no script can read it
Usually I like to also log signups and if more then 2 people signup within a 5 minute span from the same IP address it will prevent them from signing up by banning them from my website for 10-20 minutes or so, that way even if some one manually decides to spam you by manually typeing in the validation codes I only get spammed several times an hour lol