| Recommend this page to a friend! |
| Info | Documentation | Reputation | Support forum | Blog | Links |
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 86 | All time: 10,022 This week: 47 | ||||
| Version | License | PHP version | Categories | |||
| php-input-class 1.0.0 | MIT/X Consortium ... | 5 | HTTP, PHP 5, AJAX |
| Description | Author | |||||||||||||||||||||||
This package can process the current HTTP request values. |
| |||||||||||||||||||||||
Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run: composer require lablnet/input
This class use lablnet/http-client library.
1. Supported method get,post,put,patch,delete,files,others. 2. Clean input method(clean XSS attack/sanitize input). 3. Determine whether request is ajax or not. 4. Restore line breaks method.
It can access the HTTP request values and return them in a more convenient way to the application. Currently it can check the input values when using the GET, POST, PUT, PATCH, DELETE, FILES etc parameters, filter the parameter values, check whether request is sent by a browser using AJAX, word wrap parameter values, check whether the request is a form submission, fix parameter value line breaks.
> This class provide helpers functions for easily use of class.
You can get input by calling input helpers or Input::input method
require_once "../vendor/autoload.php";
$username = input('username');
//in OOP style
use Lablnet\Input;
require_once "../vendor/autoload.php";
$username = Input::input('username');
You can escape input by calling escape helpers or Input::escape method
require_once "../vendor/autoload.php";
$username = escape(input('username'));
//in OOP style
use Lablnet\Input;
require_once "../vendor/autoload.php";
$username = Input::clean(Input::input('username'));
You can determine current request by calling is_ajax helpers or Input::isAjax method
require_once "../vendor/autoload.php";
if (is_ajax('name')) {
//ajax
}
//in OOP style
use Lablnet\Input;
require_once "../vendor/autoload.php";
if (Input::isAjax('name')) {
//ajax
}
You can restore line breaks by calling restore_line_break helpers or Input::restoreLineBreaks method
require_once "../vendor/autoload.php";
$comment = restore_line_break(escape(input('username')));
//in OOP style
use Lablnet\Input;
require_once "../vendor/autoload.php";
$comment = Input::restoreLineBreaks(Input::clean(Input::input('username')));
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Lic. | License text | |||
| Doc. | Documentation | |||
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% |
|
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.