Jump to content

Image Verifcation


onlyican

Recommended Posts

Hey

I have a website, where certain pages, i allow people to add comments, Call me stupid, but I never had an image verification on there. I approve all comments before they go online, using my Admin Control which I built

But recently I am receivin 10 posts a day from some company for sex, and drugs. Which tells me that I need image verification

I am due in hospital tomorrow, (need to be there at 8am) so i have to do this quickly,

I created a basic function
[code]
<?php
if($_GET["id"]){

$im = imagecreate(100, 30);
$id = $_GET["id"];

$bg = imagecolorallocate($im, 0, 0, 0);
$textcolor = imagecolorallocate($im, 255, 255, 255);

imagestring($im, 5, 25, 5, $id, $textcolor);

header("Content-type: image/png");
imagepng($im);
?>
}
[/code]

Ok I didn't create it, I used the one on php.net for showing a string, I am short on time

then on the page I am calling the image, I was thinking of doing something like

[code]
<?php
$options = "ABCDEFGHJKLMNPRSTUVWXYZ23456789";
$id = "";
for($i = 0; $i < 5; $i++){
$id .= $options{rand(1, 31)};
}

echo "<form method='post' action=''>\n"
//rest of form here
."<input type='hidden' name='id' value='".$id."' />\n"
."<img src='sec_img.php?id=".$id."' /><br />\n"
."Please enter the text from the image into this box<br />\n"
."<input type='text' name='validate' value=''>\n"
//end form bla bla bla

?>
[/code]

I just want to know as I am calling the image with the GET method, and adding a value in the form, if a bot can read this yet.

Many Thanx
Link to comment
https://forums.phpfreaks.com/topic/20305-image-verifcation/
Share on other sites

[quote author=onlyican link=topic=107554.msg431705#msg431705 date=1157909392]
that link is coming up as a 404
[/quote]

Not exactly. It's a '404' page complete with a menu that links to the scripts.  I relocated the php_noob2006 to 'live' status and re-directed with .htaccess :)
Link to comment
https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89464
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.