Friday, March 27, 2009

Thursday, January 29, 2009

Example of how to do CAPTCHA Php

Hey guys, thought I'd throw out a CAPTCHA example using GD for anyone who's wondered how they were done. This is just a simple basis for building a captcha image with php, nothing too fancy.

Features:

* TTF font usage
* Random from set of bg's
* Random colors for each char
* Random y-loc of chars
* Random angles of rotation for each char


//Start the session so we can store the key
session_start();

$font = "allstar.ttf";
$bgs = array("cap.png","cap2.png","cap3.png");
$bg = $bgs[rand(0,2)];

/*
* Generate a random string for captcha
*(doesn't matter how you do this)
* I just double md5'd microtime * a random int then randomly selected a length 5 char section of it
*/
$random = md5(md5(microtime() * rand(0,50)));
$string = substr($random,rand(0,27),5);

//Store the encrypted key in the session
$_SESSION['key'] = md5($string);

//Start the captcha image from one a fuzzy bg
$captcha = imagecreatefrompng($bg);

//Set the colors to use(RGB values)
$colors = array(imagecolorallocate($captcha, 0, 0, 0), imagecolorallocate($captcha, 192, 0, 0),
imagecolorallocate($captcha, 0, 0, 192), imagecolorallocate($captcha, 0, 192, 0),
imagecolorallocate($captcha, 226, 154, 0));

/*
* Now I write to the captcha image each char with the colors
* Using allstar.ttf font
* randomly generate angle
* randomly generate y-loc
* randomly generate color
*/
imagettftext($captcha, 18, rand(-25, 25), 10, rand(30, 40), $colors[rand(0,4)], $font, substr($string,0,1));
imagettftext($captcha, 18, rand(-25, 25), 35, rand(30, 40), $colors[rand(0,4)], $font, substr($string,1,1));
imagettftext($captcha, 18, rand(-25, 25), 60, rand(30, 40), $colors[rand(0,4)], $font, substr($string,2,1));
imagettftext($captcha, 18, rand(-25, 25), 85, rand(30, 40), $colors[rand(0,4)], $font, substr($string,3,1));
imagettftext($captcha, 18, rand(-25, 25), 110, rand(30, 40), $colors[rand(0,4)], $font, substr($string,4,1));

//Display the image
header("Content-type: image/png");
imagepng($captcha);
?>
From there all you need to do to utilize the captcha is create a form and test an md5'd post var against the session code. Enjoy, hope this is helpful to some.

Baldaris69[at]yahoo.com

Sunday, January 11, 2009

webdirectory















Internet Number One Directory Information
AAAWebDirectory.com
Arakne-Links Directory
Free Web Directory
Faba Directory
Anne Web Directory
Get Page Rank 10 - SEO Experiment
Arakne-Links Directory
Seven Directory
Seven Directory
DirSubmitSite
free Directory submission">MRfrancisco
lcroskey.com internet web directory
lcroskey.com internet web directory
WebsLink Directory
Findsome.info
Outlook Repair
Computer Directory
Hard Drive Recovery
Decks
Undelete
Used Cars
Submit site - web site promotion - Directory
fast4u.co.uk Directory
- Favourite Link - The ultimate Directory
Findadd Directory
JamJaa.com
Get Listed In the Green Directory.
Free web directory
Clarib Web Directory
Free Link Index - Internet Site Resources and Information
Fresh Dir
Web Directory
Web Directory, Add a site, add a link, suggest site
Fresh Dir
Web Directory
Free Website Directory
Web Directory
Web Directory, Add a site, add a link, suggest site
SEO Search Bot - Niche Web Link Directory
Search Engine Optimisation
Girls And Gambling Directory
Findsome.info

Findsome.info
GooLinx
GoSearchShopping Web Directory
GreatDir.com
Web Resources for IT Professionals
GooLinx

Web Directory
HE Directory SEO Friendly and Human Edited
Health and Wellness Directory
Home Decoration Gift Shop Directory
I-Searches
SEO Master Iftekhar khan General Web Directory
Idorel Internet Directory
Invision Power Board Forum Directory
It's The Links Entree
Free Submission Directory
SEO Search Bot - Niche Web Link Directory
High Pagerank Google PR Link Directory - Transops.Net
Adevarate.Net
Uncem Premium Directory
Free Web Directory
Google Maps Directory
Links Market
Auranafrica.org
directory submission free cheap web directory link website listing

Search Engine Submission - AddMe

LINK ADD URL Seo Friendly Web Directory
eWebSubmission.com - Global Web Submission Directory
dmozlist.com Internet Directory - Submit your site FREE. Drive quality Traffic
Mangalorecustoms.org Web Directory
Orlando Vacation Homes
Global Business Directory with Best Business and Websites Links - Worldwide Coverage
WebMasters Experience Directory
High Pagerank Google PR Link Directory - Transops.Net
CFAF Directory

Free Popular Link Directory
SEO Link Directory
Her Blog Directory
Her Blog Directory
Checking Point Directory
Auranafrica.org
Bio Div
Cagtermal
Directory Home
Costa Rica Travel and Business Directory
Blogs That Follow
SEO Executive
inredesign.eu - Web addresses directory
Cagtermal
SEO Executive
AAAWebDirectory.com
Blogs That Follow
Free Web Directory
Bio Div
Add URL
Add Url
Amfibi Web Search & Directory
PooZL Web Directory
LINK ADD URL Seo Friendly Web Directory
Cheap domain Name registration, Cheap web hosting
Add url
Add Your URL Directory
Web Directory
Cheap SEO Friendly Directory Submissions
Add Url for Free - Free Url Submission to SearchEngines, FFA and Directory
Add a URL
Web Hosting Reviews
free Directory submission
Dir World Online
SirPac SEO Internet Web Directory - Add Your URL for Free
Ambusha Web Site Directory
Directory World Online
Add URL & Submit Site to Free Website Directory
UK Link Exchange Free Link
Mailing Lists for any industry, mortgage marketing ideas.
Computers Directory of North America
M. Zabita Directory
Personal injury lawyer London








http://www.submitdir.com/
http://www.cheapdirectory.net/submit.php
http://www.linkaddurl.com/submit.php
http://www.ewebsubmission.com/submit.php
http://www.allbigbrotherlinks.com/submit.php
Checking Point Directory
www.gamingdirectory.co.uk








To add your directory/website here mail me at




baldaris69[at]yahoo[dot]com