PHP Classes
elePHPant
Icontem

PHP Input Class: Process the current HTTP request values

Recommend this page to a friend!
  Info   View files Documentation   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-02-06 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 54 All time: 9,542 This week: 259Up
Version License PHP version Categories
php-input-class 1.0.0MIT/X Consortium ...5HTTP, PHP 5, AJAX
Description Author

This package can process the current HTTP request values.

It can access the HTTP request values and return them in a more convinient way to the application.

Currently it can check the input values when using the parameters of requests of type GET, POST, PUT, PATCH, DELETE, 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.

Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 44 packages by
Country: Pakistan Pakistan
Age: 18
All time rank: 109015 in Pakistan Pakistan
Week rank: 41 Up2 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 4x

 

Details

PHP input class

This package can process the current HTTP request values.

Requirement

  1. PHP
  2. Composer

Installation

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

Dependencies

This class use lablnet/http-client library.

Feature

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.

Description

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.

Input

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');

Escape

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'));

Determine whether request is ajax/xhr?

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
}

Restore line breaks

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')));

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (1 file, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Readme.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imagefunctions (1 file)
  Plain text file Input.php Class Class source

  Files folder image Files  /  src  /  functions  
File Role Description
  Accessible without login Plain text file helpers.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:54
This week:0
All time:9,542
This week:259Up