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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.