onlyican Posted September 10, 2006 Share Posted September 10, 2006 HeyI 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 builtBut recently I am receivin 10 posts a day from some company for sex, and drugs. Which tells me that I need image verificationI am due in hospital tomorrow, (need to be there at 8am) so i have to do this quickly, I created a basic function[code]<?phpif($_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 timethen 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 More sharing options...
Orio Posted September 10, 2006 Share Posted September 10, 2006 [quote author=AndyB link=topic=104243.msg415703#msg415703 date=1155583233]with GD, my captcha script is at www.digitalmidget.com/php_noob2006/captcha.php[/quote]Credit@AndyBOrio. Link to comment https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89426 Share on other sites More sharing options...
onlyican Posted September 10, 2006 Author Share Posted September 10, 2006 that link is coming up as a 404 Link to comment https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89437 Share on other sites More sharing options...
°°Ben³ Posted September 10, 2006 Share Posted September 10, 2006 So you may follow the link in the menu bar?--> http://www.digitalmidget.com/php_noob/captcha.php Link to comment https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89462 Share on other sites More sharing options...
AndyB Posted September 10, 2006 Share Posted September 10, 2006 [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 More sharing options...
onlyican Posted September 10, 2006 Author Share Posted September 10, 2006 but my question is Can a bot read the source code to get the image idThe one I am using works just the way I want it, easy to read Link to comment https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89467 Share on other sites More sharing options...
Orio Posted September 10, 2006 Share Posted September 10, 2006 No, it uses sessions therefore it cant know what's written.Orio. Link to comment https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89480 Share on other sites More sharing options...
onlyican Posted September 10, 2006 Author Share Posted September 10, 2006 By CODE:So ur saying I should use sessions on my code Link to comment https://forums.phpfreaks.com/topic/20305-image-verifcation/#findComment-89494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.