Jump to content


Photo

Authorization Code Generation


  • Please log in to reply
3 replies to this topic

#1 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 10 March 2006 - 10:29 PM

Hi,

I've been looking and I have not any tutorials about making a script for generating those authorization/access codes with the GD.

I've found places that give people scripts to do it, but I am more interesting in following some sorta tutorial about how this works.

Thanks.




#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 10 March 2006 - 10:36 PM

Tutorial?

Create random 'security word' and store in SESSION var
Get session var and use in a php script with GD to generate the image (bells and whistles optional)
Check form responses to see if user-entered 'security word' matches what's stored in the session variable.

That's about it. The rest you should be able to learn from reading scripts ... which may depend on how well-written and/or documented they are. Mine is beautifully written and spectacularly well-documented :) Help yourself/take a look if you're interested - [a href=\"http://www.digitalmidget.com/php_noob/captcha.php\" target=\"_blank\"]http://www.digitalmidget.com/php_noob/captcha.php[/a]
Legend has it that reading the manual never killed anyone.
My site

#3 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 13 March 2006 - 06:35 PM

The code you have it great.

Though, I dont seem to have imagecreatefromjpeg() which tells me GD isnt enabled in PHP. I can not find any mention of GD in phpinfo().

I installed GD onto the server. It was able to make the gddemo.png and a couple of other files.

My php version seems to be 5.0 but no where in the php.ini file does it show extension=php_gd2 in it.

How do I go about enabling GD in PHP? I've used getimagesize() and I thought that was a function of GD?

Do I have to recompile PHP with enabling GD support??

#4 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 13 March 2006 - 07:48 PM

I fixed it.

Just re-ran the update and install for yum php-gd. Restarted httpd and voila, worked.

:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users