473,782 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Captcha image Text Size

Hi,

Learning PHP code; playing with various methods of generating captcha
codes:

In the code below, how would I change the size of the text displayed in
the captcha code?
Is it even possible with this method?
TIA,
Twayne

--------------------------
<?php

session_start() ;

$width = 120;

$height = 40;

$length = 5;

$baseList = '23456789abcdfg hjkmnpqrstvwxyz ABCDEFGHIJKLMNP QRSTUVWXYZ';

$code = "";

$counter = 0;

$image = @imagecreate($w idth, $height) or die('Cannot initialize GD!');

for( $i=0; $i<10; $i++ ) {

imageline($imag e,

mt_rand(0,$widt h), mt_rand(0,$heig ht),

mt_rand(0,$widt h), mt_rand(0,$heig ht),

imagecoloralloc ate($image, mt_rand(150,255 ),

mt_rand(150,255 ),

mt_rand(150,255 )));

}

for( $i=0, $x=0; $i<$length; $i++ ) {

$actChar = substr($baseLis t, rand(0, strlen($baseLis t)-1), 1);

$x += 10 + mt_rand(0,10);

imagechar($imag e, mt_rand(3,5), $x, mt_rand(5,20), $actChar,

imagecoloralloc ate($image, mt_rand(0,155), mt_rand(0,155),
mt_rand(0,155)) );

$code .= strtolower($act Char);

}
header('Content-Type: image/jpeg');

imagejpeg($imag e);

imagedestroy($i mage);

$_SESSION['securityCode'] = $code;

?>

\

---------------------------------


Apr 8 '08
11 2438
"Richard" <root@localhost wrote in news:47fc2c3d$0 $30410$dbd4d001
@news.euronet.n l:
>>
"rf" <rf@x.invalidwr ote in message
news:82******* *********@news-server.bigpond. net.au...
>>"Twayne" <no****@devnull .spamcop.netwro te in
news:%IUKj.43 10$mL2.220
@trndny03:

.oO(Twayn e)
>
>Learning PHP code; playing with various methods of generating
>captcha
>codes:
>
You should forget it. Graphical CAPTCHAs are a huge accessibility
problem and many of them are already broken and can be read by
bots.
They are definitely _not_ a solution.
>
Micha

1. Who said anything about USING captcha codes on a web site?
Only
you, I'm afraid.

Given that the vast majority of questions in this group relate to
using
PHP to build web pages I would think the onus is on *you* to mention
if
you are doing otherwise.
--
Richard
Killing all threads involving google groups
The Usenet Improvement Project: http://improve-usenet.org

Ehm.... he DID mention that.
:-P
Richard.


Perhaps you could indicate exactly in the above quoted thread where
the OP specifically stated that this was *not* for use in a publicly
viewable web site. In my experience people "learn PHP" by building
their first web page.

Good grief charley brown; I didn't say it wasn't for use in accessing a
nuclear reactor, nor for protecting anything, nor anything about a web
site, nor ... ... ... ... ... ... .
What you want and what you're going to get from people are two vastly
different things. I don't get why my playing with different methods of
accomplishing the same things captcha code can would piss you off. You
seem to actually be pissed that someone would use captcha code to learns
some things if they weren't going to use it for catpcha code on a web
site. That's interesting, to say the least.
I can just imagine your response if I hadn't mentioned "captcha" and
just said I was fiddling with this code and then showed it! There are
so many variations on how to create captcha code rectangles that it
makes for a great example of different ways todo things. Something I
suspect you are failing to recognize is that studying how others do
things is a great learning tool. I suppose I'm an "oddball" compared to
you since I actually KNOW what code does and if I don't, I try to learn
it and if I can't, I'll ask what appears to be a better authority then
my manuals etc. to figure it out. A forest is made of many trees; in
this case all you see is one forest, I think.

Cheers,

Twayne
Apr 9 '08 #11
Krustov wrote:
>>They are definitely _not_ a solution.

What do you suggest as a alternative ? .

Here are some nice suggestions
http://www.w3.org/TR/turingtest/

best regards
Piotr

Thanks; I had actually found that site already but I appreciate your
effort in posting it; many others will see it too and that's good. Lots
of good reverences there and also at w3c.

--
Regards,

Twayne

Open Office isn't just for wimps anymore;
OOo is a GREAT MS Office replacement
www.openoffice.org
Apr 9 '08 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2793
by: Krishna Kumar | last post by:
Hai all, I am doing a project in .net and in that project I have a problem in capturing text from an image. i.e images like CAPTCHA images . which has inbuilt text with in the image.So, Can any one suggest me how to continue my work or give their valuable suggestions for capturing text in the CAPTCHA image . yours KrishnaKumar
0
1440
by: want2learn | last post by:
Hi. I have this CAPTCHA image for .Net in C-Sharp and translate it into VB and as Code_Behind. http://www.mbarrick.com/blog/d6plinks/20061221-01 If i run the site/script i get the site but there is not being showing an CAPTCHA image, Why not !? http://www.kennelenggaard.dk/captcha.aspx Hope someone can help me with this.
0
1743
by: aaronwmail-usenet | last post by:
Announcing SkimpyGimpy Support for PNG image CAPTCHA generation and PNG canvases. You can now use SkimpyGimpy to generate CAPTCHA text representations as PNG image files in addition to preformatted text ASCII art, and WAVE format audio streams, either from command lines or within Python programs. Also general support for drawing text and
7
10164
by: mitchell | last post by:
hi i m using IE 6.0. i want to refresh just the captcha part when the user clicks on an image. i searched for articles on it and got a fairly good understanding of it. but i m still unable to get any results. i have used Simple AJAX Code-Kit (SACK) (http://www.twilightuniverse.com/)
4
5795
by: xeiter | last post by:
Hi, I have a captcha script on my website located at /captcha.php. What it does it generates an image with the code, displays the image (gd2) and saves the value of the code in session. How do I access that code in session from my c# windows application. I have a form in my application for registering users. The application then calls to the webserver and uses regular .php page to submit user registration. It has captcha and thats why I need...
4
1510
by: mathewgk80 | last post by:
Hi all, I displaed some random numbers in a textbox.. I am having a captcha image and i would like to display that random numbers in captcha image.. The code i used to display the random numbers in a textbox is shown below... Random r = new Random(); StringBuilder sb = new StringBuilder();
7
1749
by: Joel Fireman | last post by:
I'm looking at the results of searching for "captcha" and "php" - there's a couple hundred of hits that seem to be uniquish... Before I start flogging them, I thought I'd ask the good folks here which one(s) you prefer... and if you disagree with another's choice, why?
0
1597
by: readnlearn | last post by:
hai, i have written this below code for displaying captcha image whenever i entered incorrect uname,password in login page. for that i disable the controls of captcha like textbox,labels,button and image control in source code of designing part. and i enable those controls in an if condition which display captcha. but if i entered correct information which is in database it shouldn't navigate to the corresponding page and also if entered...
10
7858
by: jeddiki | last post by:
Hi, I have a captcha script which should pick up a background image and add some random letters to it and re-display This is the part of the form that the captcha image is part of: <span >Verification Image:</span> <span ><img src="captcha.php" id="captcha" /> <a href="#renew" onclick="javascript: document.getElementById('captcha').src = 'captcha.php?' + Math.random();">refresh</a> </span>
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9942
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.