Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 02-12-2006, 02:02 AM   #1 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Image Validation

I have been looking on HotScripts.com for this type of script but I haven't been able to find one.

I want a pretty simple one, hopefully one in a small function that is easy to read and change.

http://cracker.com.au/classifieds/me...142035706.aspx

The box down the bottom is what I'm looking for.

If anyone knows of one of these scripts can they please post me a link and I shall go download it

Thanks in advance.
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 02-12-2006, 10:41 AM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
If you would like to edit it in yourself then you can use this

From www.php.net/gd

PHP Code:
<?php
function generateValidationImage($rand) {
   global 
$site_font_path;
   global 
$site_font_validation;
   
$width 120;
   
$height 40;
   
$image imagecreate($width$height);
   
$bgColor imagecolorallocate ($image255255255);
   
$textColor imagecolorallocate ($image000);

   
// Add Random noise
   
for ($i 0$i 250$i++) {
     
$rx1 rand(0,$width);
     
$rx2 rand(0,$width);
     
$ry1 rand(0,$height);
     
$ry2 rand(0,$height);
     
$rcVal rand(0,255);
     
$rc1 imagecolorallocate($image,
   
rand(0,255),
   
rand(0,255),
   
rand(100,255));

     
imageline ($image$rx1$ry1$rx2$ry2$rc1);
   }

   
// write the random number
   
$font imageloadfont($site_font_path."/".$site_font_validation);
   
imagestring($image$font30$rand$textColor);

   
// send several headers to make sure the image is not cached
   // Date in the past

   
header("Expires: Mon, 23 Jul 1993 05:00:00 GMT");

   
// always modified
   
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");

   
// HTTP/1.1
   
header("Cache-Control: no-store, no-cache, must-revalidate");
   
header("Cache-Control: post-check=0, pre-check=0"false);

   
// HTTP/1.0
   
header("Pragma: no-cache");

   
// send the content type header so the image is displayed properly
   
header('Content-type: image/jpeg');

   
imagejpeg($image);
   
imagedestroy($image);
  }

?>
The $site_font_path should be set to something like "/home/user/www/fonts".
The $site_font_validation should be set to the name of the GD font file,
like "anonymous.gdf".

You can view and download the code here:
http://www.digital-seven.net/?option...ask=view&id=67
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-12-2006, 07:21 PM   #3 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Woh thanks m3lt I never knew what it was called. I will look into it now.

Cheers
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-14-2006, 04:56 AM   #4 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Thanks Kyle, I got it working

http://sketchthat.com/test1.php
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-14-2006, 06:05 AM   #5 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
No problem, looks good
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Markup Validation EWSitesCom SEO Forum 8 06-03-2007 02:49 AM
Web-Standards Validation bedlam17 Coding Forum 4 05-28-2007 12:03 AM
Help me understand Validation. sachi Web Design Lobby 4 02-11-2007 02:32 PM
My first w3c validation awall19s brother SEO Forum 1 08-11-2006 09:56 AM
Validation For Forms Limit Coding Forum 4 01-08-2004 08:39 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 04:39 AM.
© Copyright 2008 V7 Inc