atomicrabbit Posted June 15, 2007 Share Posted June 15, 2007 Hey ppl, I started using cryptographp just recently and made a little change to it. As you notice from their downloads page, they have about 11 styles you can download. I altered the code in the php files to randomize the usage of each of the styles. So every time you reload the captcha, it will use a different style. This is how you can do it: 1) First, download the latest version of cryptographp, then download all the styles from the link above, and extract each of them to a separate folder. 2) Go to each of the styles folder and rename each of the cryptographp.cfg.php files to cryptographp.cfg1.php, cryptographp.cfg2.php, cryptographp.cfg3.php, ..... cryptographp.cfg12.php. Then copy all of them to the cryptographp directory. Rename the original cryptographp.cfg.php to cryptographp.cfg0.php. Make sure to copy any extra files, if applicable. For example, the bluesky style has a sky.png image that needs to be copied the the cryptographp installation folder. Read teh readme files in each style for more info. 3) You should now have 13 cryptographp.cfg#.php files from 0-12. Open the cryptographp.inc.php and go to line 28 and add the following: // randomly determine which captcha style to use srand((double)microtime()*1000000); $style_num = rand(0,12); $style_file = "cryptographp.cfg" . $style_num . ".php"; 4) In the same file, search for: else $_SESSION['configfile']="cryptographp.cfg.php"; and replace it with: else $_SESSION['configfile']=$style_file; 5) Upload all the altered files (overwrite if it asks): cryptographp.inc.php cryptographp.cfg0.php cryptographp.cfg1.php cryptographp.cfg2.php cryptographp.cfg3.php cryptographp.cfg4.php cryptographp.cfg5.php cryptographp.cfg6.php cryptographp.cfg7.php cryptographp.cfg8.php cryptographp.cfg9.php cryptographp.cfg10.php cryptographp.cfg11.php cryptographp.cfg12.php (and any extra files from the styles, if applicable) Now, after you do the above, every time you reload the page or press the reload button, it will randomly select a style, then do whatever it normally does (randomly chooses the characters and generates the image) Quote Link to comment https://forums.phpfreaks.com/topic/55676-cryptographp-edit/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.