473,769 Members | 1,637 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 #1
11 2437
..oO(Twayne)
>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
Apr 8 '08 #3
<comp.lang.ph p>
<Michael Fesser>
<Tue, 08 Apr 2008 23:44:26 +0200>
<ij************ *************** *****@4ax.com>
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.
What do you suggest as a alternative ? .
--
www.krustov.co.uk
Apr 8 '08 #4
this may help you
http://www.php.net/manual/en/functio...char.php#54000
Thanks, I have that manual; it's a great reference and that's one way to
do it, for sure. What I'm really doing is going through a learning
process with PHP and the GD and using captcha for a subject. I have
about three different and excellent methods pulled together and I'm
trying to figure out how to use the best parts of each in one, new
method. Mostly noodling for the education.

Appreciate the comeback!
--
Regards,

Twayne

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

Apr 9 '08 #5
rf
"Twayne" <no****@devnull .spamcop.netwro te in news:%IUKj.4310 $mL2.220
@trndny03:
>.oO(Twayne)
>>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
Apr 9 '08 #6

"rf" <rf@x.invalidwr ote in message
news:82******** ********@news-server.bigpond. net.au...
"Twayne" <no****@devnull .spamcop.netwro te in
news:%IUKj.4310 $mL2.220
@trndny03:
>>.oO(Twayne)

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.
Apr 9 '08 #7
rf
"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.431 0$mL2.220
@trndny03:
>>>.oO(Twayne )

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.

--
Richard
Killing all threads involving google groups
The Usenet Improvement Project: http://improve-usenet.org
Apr 9 '08 #8
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
Apr 9 '08 #9
"Twayne" <no****@devnull .spamcop.netwro te in news:%IUKj.4310 $mL2.220
@trndny03:
>>.oO(Twayne)

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.

lol, I *said* I was playing with it. Whether i plan to use it or not
has little to do with anything else. Any thinking person answers a
question and THEN if there are some followons, adds them as maybe
caveats or ... .
Answering questions that aren't asked are signs of ego problems at
the other end, IMO. I wrote the post properly for what I wanted to ask
about.

Twayne


Apr 9 '08 #10

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
1438
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
10163
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
5794
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
1746
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
7856
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
10211
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
10045
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
9994
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
8870
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
7408
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...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3958
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
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.