{"id":20301459,"url":"https://github.com/hashaam-zahid/php-form-handler","last_synced_at":"2026-06-09T05:05:07.015Z","repository":{"id":209743819,"uuid":"724849171","full_name":"hashaam-zahid/php-form-handler","owner":"hashaam-zahid","description":"The PHP Form Handler Library is designed to fortify form data processing by implementing robust security measures, including variable sanitization, XSS (Cross-Site Scripting) attack prevention, and CSRF (Cross-Site Request Forgery) token management.","archived":false,"fork":false,"pushed_at":"2023-11-29T11:31:07.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T10:50:52.172Z","etag":null,"topics":["csrf-protection","filter-variables","form-handler","php","xss"],"latest_commit_sha":null,"homepage":"","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/hashaam-zahid.png","metadata":{"files":{"readme":"readme.md","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":"2023-11-28T23:12:10.000Z","updated_at":"2025-01-06T10:51:03.000Z","dependencies_parsed_at":"2023-11-28T23:49:51.945Z","dependency_job_id":"103e4115-b63c-428e-89d3-99a573ed446e","html_url":"https://github.com/hashaam-zahid/php-form-handler","commit_stats":null,"previous_names":["hashaam-zahid/php-form-handler"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashaam-zahid%2Fphp-form-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashaam-zahid%2Fphp-form-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashaam-zahid%2Fphp-form-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashaam-zahid%2Fphp-form-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashaam-zahid","download_url":"https://codeload.github.com/hashaam-zahid/php-form-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241796295,"owners_count":20021642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csrf-protection","filter-variables","form-handler","php","xss"],"created_at":"2024-11-14T16:25:58.720Z","updated_at":"2026-06-09T05:05:01.974Z","avatar_url":"https://github.com/hashaam-zahid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### PHP Form Handler Library\nThe PHP Form Handler Library is designed to fortify form data processing by implementing robust security measures, including variable sanitization, XSS (Cross-Site Scripting) attack prevention, and CSRF (Cross-Site Request Forgery) token management.\n\n### Author\nHashaam Zahid\n\n### Key Features\nVariable Sanitization:\n\nPrevents malicious code injection by filtering form input data to remove potentially harmful characters.\n\nXSS Attack Prevention:\nUtilizes PHP's filter library and HTML encoding techniques to defend against Cross-Site Scripting attacks.\n\nCSRF Token Management:\nImplements CSRF token generation and validation to safeguard against Cross-Site Request Forgery attacks.\n\n### Goal\nThe primary objective of this repository is to provide a secure and reliable PHP library for handling form submissions. It empowers developers to:\n\nSafely process form input data by filtering and sanitizing variables.\nProtect web applications from XSS vulnerabilities by filtering out malicious input.\nImplement CSRF tokenization to ensure secure and authenticated form submissions.\n### Folder Structure\n ```php\n│\n├── src/\n│   ├── FormHandler/\n│   │   ├── FormHandler.php\n│   │   ├── Validation/\n│   │   │   └── Validator.php\n│   │   └── Security/\n│   │       └── CSRFToken.php\n│   │\n│   └── ... (other library files)\n│\n├── test_form_handler.php  \u003c-- Your test file here\n├── composer.json\n└── vendor/\n    └── ... (Composer dependencies)\n```\n    \n## Features\n\n- **Input Filtering:** Sanitize form input data to prevent malicious code injection.\n- **Form Validation:** Validate form fields to ensure required data is present and in the correct format.\n- **CSRF Protection:** Guard against Cross-Site Request Forgery attacks using tokens.\n\n## Setup\nUse Xampp, Mampp any Server with start with 127.0.0.1\n\n### Installation via Composer\n\n1. Install the library using Composer:\n    ```bash\n    composer require hashaam-zahid/php-form-handler\n    ```\n\n2. Include the Composer autoloader in your PHP script:\n    ```php\n    require_once 'vendor/autoload.php';\n    ```\n\n### Manual Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/hashaam-zahid/php-form-handler.git\n    ```\n\n2. Include the necessary files in your PHP project:\n    ```php\n    require_once 'path/to/vendor/autoload.php';\n    ```\n\n## Usage\n\nInstantiate the `FormHandler` class and use its methods to process form submissions securely.\n\n### Example:\n\n```php\n// Include autoload file\nrequire_once 'path/to/vendor/autoload.php';\n\nuse FormHandler\\FormHandler;\n\n$formHandler = new FormHandler\\FormHandler();\n\n// Process form submission\nif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n    $postData = $_POST;\n\n    // Filter form input data\n    foreach ($postData as $key =\u003e $value) {\n        $postData[$key] = $formHandler-\u003esanitizeInput($value);\n    }\n\n    // Handle form submission\n    $result = $formHandler-\u003ehandleForm($postData);\n\n    if ($result['success']) {\n        // Form submitted successfully\n        echo $result['message'];\n    } else {\n        // Form submission failed\n        echo $result['message'];\n    }\n}\n```\n### Contributing\nContributions are welcome! Feel free to fork the repository, make changes, and create pull requests.\n\n\n### License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n\nThis updated README.md includes detailed feature descriptions, comprehensive setup instructions using Composer or manual installation, usage guidelines, information about contributing, the author, and the license details. `hashaam-zahid` in the installation instructions with your actual GitHub username or organization name. Adjust the paths and additional details according to your project's structure and requirements.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashaam-zahid%2Fphp-form-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashaam-zahid%2Fphp-form-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashaam-zahid%2Fphp-form-handler/lists"}