{"id":21090933,"url":"https://github.com/gjerokrsteski/php-captcha-generator","last_synced_at":"2026-02-27T03:02:08.267Z","repository":{"id":148208308,"uuid":"1174620","full_name":"gjerokrsteski/php-captcha-generator","owner":"gjerokrsteski","description":"Creates a security-captcha-image with the PHP's GD library for your web form.","archived":false,"fork":false,"pushed_at":"2016-06-29T14:52:58.000Z","size":237,"stargazers_count":9,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T13:44:31.922Z","etag":null,"topics":["captcha","oop","php","php7"],"latest_commit_sha":null,"homepage":"http://gjerokrsteski.github.com/php-captcha-generator","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gjerokrsteski.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-16T16:54:01.000Z","updated_at":"2022-02-26T22:11:14.000Z","dependencies_parsed_at":"2023-05-30T01:00:43.303Z","dependency_job_id":null,"html_url":"https://github.com/gjerokrsteski/php-captcha-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gjerokrsteski/php-captcha-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjerokrsteski%2Fphp-captcha-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjerokrsteski%2Fphp-captcha-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjerokrsteski%2Fphp-captcha-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjerokrsteski%2Fphp-captcha-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gjerokrsteski","download_url":"https://codeload.github.com/gjerokrsteski/php-captcha-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjerokrsteski%2Fphp-captcha-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29883111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"online","status_checked_at":"2026-02-27T02:00:06.759Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","oop","php","php7"],"created_at":"2024-11-19T21:42:11.049Z","updated_at":"2026-02-27T03:02:08.235Z","avatar_url":"https://github.com/gjerokrsteski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\nCreates a security-captcha-image with the PHP's GD library for your web form. It's easy to use - just check it out now!\n\n[![Build Status](https://travis-ci.org/gjerokrsteski/php-captcha-generator.png?branch=master)](https://travis-ci.org/gjerokrsteski/php-captcha-generator)\n\nRequirements \u0026 Installation\n---------------------------\n\nIf you have the GD library (available at » http://www.libgd.org/) you will also be able to create and manipulate\nimages. The format of images you are able to manipulate depend on the version of GD you install, and any other\nlibraries GD might need to access those image formats. Versions of GD older than gd-1.6 support GIF format images,\nand do not support PNG, where versions greater than gd-1.6 and less than gd-2.0.28 support PNG, not GIF.\nGIF support was re-enabled in gd-2.0.28. Read more: http://www.php.net/manual/en/image.requirements.php\n\n\nHow to use it?\n--------------\n 1. Create a file \"captcha.php\" and make an instance of the CaptchaGenerator in it. \n You have to save the security-phrase for sample at the session. (see sample below)\n\n 2. Integrate the capture-image into you form, using HTML-Tag img src=\"captcha.php\".\n\n  ```html\n  \u003cimg src=\"captcha.php\" border=\"0\"\u003e\n  ````\n\n 3. After sending the form-data you can check if the value of the input-field \"captcha-confirmation\" equals with the security-phrase from the session. So that is all an the image should look like this:\n\n  ![Captcha Image](http://krsteski.de/wp-content/uploads/2010/09/captcha-samp.gif)\n\n\nEasy use\n-------------------\n```php\ntry\n{\n  $captcha = new CaptchaGenerator(\n    'path/to/your/font.ttf',\n    'path/to/your/background-image.gif',\n    $the_length_of_your_phrase = 4\n  );\n\n  // Intervene here the phrase\n  // and save it into the database or at the session.\n  $the_captcha_phrase = $captcha-\u003egetPhrase();\n\n  $captcha-\u003erender();\n}\ncatch (InvalidArgumentException $e)\n{\n  print $e-\u003egetMessage();\n}\n```\n\n\nCustomize some options\n---------------------------------\n```php\n// ...\n\n$captcha-\u003esetFontcolor(CaptchaGenerator::FONT_COLOR_BLUE)\n        -\u003esetFontsize(16)\n        -\u003esetPhraselength(5)\n        -\u003esetFontxmargin(55)\n        -\u003esetFontymargin(4)\n        -\u003erender();\n\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjerokrsteski%2Fphp-captcha-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjerokrsteski%2Fphp-captcha-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjerokrsteski%2Fphp-captcha-generator/lists"}