473,382 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Images

is it possible to do image manipulation with php that isn't low level?

I basically want to create some captchas manually (given a text string) but
I not sure if its possible to do. I want to ultimately do it in real time if
possible.

The idea is to turn the text into an image and then apply some image
processing(transformations that make it more random such as adding fuzz or
changing colors, etc..) to make it harder to hack.

How do websites normally go about creating them? Manually or offline?

Thanks,
Jon
Jun 6 '07 #1
6 1277
Jon Slaughter wrote:
is it possible to do image manipulation with php that isn't low level?

I basically want to create some captchas manually (given a text string) but
I not sure if its possible to do. I want to ultimately do it in real time if
possible.

The idea is to turn the text into an image and then apply some image
processing(transformations that make it more random such as adding fuzz or
changing colors, etc..) to make it harder to hack.

How do websites normally go about creating them? Manually or offline?

Thanks,
Jon

Just google for CAPTCHA and PHP. There are several examples out there
already - and all do it real time. It's really not that bad.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 6 '07 #2

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Dq******************************@comcast.com. ..
Jon Slaughter wrote:
>is it possible to do image manipulation with php that isn't low level?

I basically want to create some captchas manually (given a text string)
but I not sure if its possible to do. I want to ultimately do it in real
time if possible.

The idea is to turn the text into an image and then apply some image
processing(transformations that make it more random such as adding fuzz
or changing colors, etc..) to make it harder to hack.

How do websites normally go about creating them? Manually or offline?

Thanks,
Jon

Just google for CAPTCHA and PHP. There are several examples out there
already - and all do it real time. It's really not that bad.
lol... I guess I should have done that first... looks quite easy. Although
I'm looking to do something original with the captchas that will require
more cycles... but atleast I have somewhere to start.

Thanks,
Jon
Jun 6 '07 #3
Jon Slaughter wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Dq******************************@comcast.com. ..
>Jon Slaughter wrote:
>>is it possible to do image manipulation with php that isn't low level?

I basically want to create some captchas manually (given a text string)
but I not sure if its possible to do. I want to ultimately do it in real
time if possible.

The idea is to turn the text into an image and then apply some image
processing(transformations that make it more random such as adding fuzz
or changing colors, etc..) to make it harder to hack.

How do websites normally go about creating them? Manually or offline?

Thanks,
Jon
Just google for CAPTCHA and PHP. There are several examples out there
already - and all do it real time. It's really not that bad.
lol... I guess I should have done that first... looks quite easy. Although
I'm looking to do something original with the captchas that will require
more cycles... but atleast I have somewhere to start.
With GD:

<?php
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_JPEG)) . ';';
header('Content-Disposition: filename="' . $_SERVER['REMOTE_ADDR'] . '";');
$img = imagecreate(275,25);
$bg = imagecolorallocate($img, 102, 102, 153);
$fg = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0, $bg);
$msg = " Your IP is {$_SERVER['REMOTE_ADDR']}";
imagestring($img, 10, 5, 5, $msg, $fg);
imagejpeg($img);
imagedestroy($img);
?>

Of course you would create a random CAPTCHA or whatever floats your boat.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 6 '07 #4

"-Lost" <ma****************@techie.comwrote in message
news:5q******************************@comcast.com. ..
Jon Slaughter wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Dq******************************@comcast.com ...
>>Jon Slaughter wrote:
is it possible to do image manipulation with php that isn't low level?

I basically want to create some captchas manually (given a text string)
but I not sure if its possible to do. I want to ultimately do it in
real time if possible.

The idea is to turn the text into an image and then apply some image
processing(transformations that make it more random such as adding fuzz
or changing colors, etc..) to make it harder to hack.

How do websites normally go about creating them? Manually or offline?

Thanks,
Jon
Just google for CAPTCHA and PHP. There are several examples out there
already - and all do it real time. It's really not that bad.
lol... I guess I should have done that first... looks quite easy.
Although I'm looking to do something original with the captchas that will
require more cycles... but atleast I have somewhere to start.

With GD:

<?php
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_JPEG)) . ';';
header('Content-Disposition: filename="' . $_SERVER['REMOTE_ADDR'] .
'";');
$img = imagecreate(275,25);
$bg = imagecolorallocate($img, 102, 102, 153);
$fg = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0, $bg);
$msg = " Your IP is {$_SERVER['REMOTE_ADDR']}";
imagestring($img, 10, 5, 5, $msg, $fg);
imagejpeg($img);
imagedestroy($img);
?>

Of course you would create a random CAPTCHA or whatever floats your boat.

Yeah, I found some code but spent the last 2 hours trying to get gd to work
in zend ;/

seems adding the dll and library stuff just doens't work ;/ Works under
apache and php5 but not under the local php5 that zend uses ;/ really sucks
as it makes debugging difficult and can't seem to find the reason for it so
I guess I have to use the server to debug it ;/

(I downloaded the latest GD stuff with the php_gd2.dll and added the
extensions tag in the php.ini in zend but no luck ;/ can't even seem to find
the error reporting... but just can't get it to show up in phpinfo())

Thanks,
Jon
Jun 6 '07 #5
Jon Slaughter wrote:
"-Lost" <ma****************@techie.comwrote in message
news:5q******************************@comcast.com. ..
>Jon Slaughter wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Dq******************************@comcast.co m...
Jon Slaughter wrote:
is it possible to do image manipulation with php that isn't low level?
>
I basically want to create some captchas manually (given a text string)
but I not sure if its possible to do. I want to ultimately do it in
real time if possible.
>
The idea is to turn the text into an image and then apply some image
processing(transformations that make it more random such as adding fuzz
or changing colors, etc..) to make it harder to hack.
>
How do websites normally go about creating them? Manually or offline?
>
Thanks,
Jon
Just google for CAPTCHA and PHP. There are several examples out there
already - and all do it real time. It's really not that bad.

lol... I guess I should have done that first... looks quite easy.
Although I'm looking to do something original with the captchas that will
require more cycles... but atleast I have somewhere to start.
With GD:

<?php
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_JPEG)) . ';';
header('Content-Disposition: filename="' . $_SERVER['REMOTE_ADDR'] .
'";');
$img = imagecreate(275,25);
$bg = imagecolorallocate($img, 102, 102, 153);
$fg = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0, $bg);
$msg = " Your IP is {$_SERVER['REMOTE_ADDR']}";
imagestring($img, 10, 5, 5, $msg, $fg);
imagejpeg($img);
imagedestroy($img);
?>

Of course you would create a random CAPTCHA or whatever floats your boat.

Yeah, I found some code but spent the last 2 hours trying to get gd to work
in zend ;/

seems adding the dll and library stuff just doens't work ;/ Works under
apache and php5 but not under the local php5 that zend uses ;/ really sucks
as it makes debugging difficult and can't seem to find the reason for it so
I guess I have to use the server to debug it ;/

(I downloaded the latest GD stuff with the php_gd2.dll and added the
extensions tag in the php.ini in zend but no luck ;/ can't even seem to find
the error reporting... but just can't get it to show up in phpinfo())
Damn. Wish I could help mate, but I have never used Zend.

I wouldn't have the slightest idea where to start.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 6 '07 #6
-Lost wrote:
Jon Slaughter wrote:
>Yeah, I found some code but spent the last 2 hours trying to get gd to
work in zend ;/

seems adding the dll and library stuff just doens't work ;/ Works
under apache and php5 but not under the local php5 that zend uses ;/
really sucks as it makes debugging difficult and can't seem to find
the reason for it so I guess I have to use the server to debug it ;/

(I downloaded the latest GD stuff with the php_gd2.dll and added the
extensions tag in the php.ini in zend but no luck ;/ can't even seem
to find the error reporting... but just can't get it to show up in
phpinfo())

Damn. Wish I could help mate, but I have never used Zend.

I wouldn't have the slightest idea where to start.
Don't know if it's feasible for your project, but we use
http://recaptcha.net/whyrecaptcha.html on one of our latest sites.

It's free so long as you're not getting 1000's of sign ups a day :)

Just sign up, get a private/public key, add a bit of code to your form,
use their sample PHP for the backend and you're away, and you help
translate old books in the process using the captcha words :-p
Jun 8 '07 #7

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

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
10
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images....
6
by: wattanabi | last post by:
Greetings, I'm attempting to layout a bunch of images in a grid using DIV's instead of a table. I currently have a 3x6 table that I need to convert to css. I've seen various example of a 3 to 4...
2
by: mouseit101 | last post by:
Hi, I'm writing a script that would (hopefully) search google images for whatever, and then return a list of URLs for the image. Right now I have: $dom = new DomDocument(); $url =...
0
by: Frenchie | last post by:
Hi, I have created a very neet menu from an example found on the MSDN library at: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitembinding.imageurlfield.aspx My...
1
by: Cerebral Believer | last post by:
Hi folks, I am using the following code for mouse over (roll-overs) in my XHTML code. <a onmouseover="document.getElementById('sitemap').src = '../images/buttons/sitemap_mo.jpg';"...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
5
by: remon87 | last post by:
I need some help. I have javasript that creates the submenu but it works if I have a text with css. I need it to do the same with a roll over images. so when I click on the image the submenu...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.