1. Go to this page and download the library: Download nette/http library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$all = $httpRequest->getQuery(); // array of all URL parameters
$id = $httpRequest->getQuery('id'); // returns GET parameter 'id' (or null)
$all = $httpRequest->getPost(); // array of all POST parameters
$id = $httpRequest->getPost('id'); // returns POST parameter 'id' (or null)
$file = $httpRequest->getFile('avatar');
if ($file->hasFile()) { // was any file uploaded?
$file->getName(); // name of the file sent by user
$file->getSanitizedName(); // the name without dangerous characters
}
$files = $httpRequest->getFiles();
$sessId = $httpRequest->getCookie('sess_id');
$cookies = $httpRequest->getCookies();
echo $httpRequest->getMethod(); // GET, POST, HEAD, PUT
// Header sent by browser: Accept-Language: cs,en-us;q=0.8,en;q=0.5,sl;q=0.3
$langs = ['hu', 'pl', 'en']; // languages supported in application
echo $httpRequest->detectLanguage($langs); // en
$factory = new Nette\Http\RequestFactory;
$httpRequest = $factory->fromGlobals();
// remove spaces from path
$requestFactory->urlFilters['path']['%20'] = '';
// remove dot, comma or right parenthesis form the end of the URL
$requestFactory->urlFilters['url']['[.,)]$'] = '';
// clean the path from duplicated slashes (default filter)
$requestFactory->urlFilters['path']['/{2,}'] = '/';
// section will expire after 20 minutes
$section->setExpiration('20 minutes');
// variable $section->flash will expire after 30 seconds
$section->setExpiration('30 seconds', 'flash');
use Nette\Http\Url;
$url = new Url;
$url->setScheme('https')
->setHost('localhost')
->setPath('/edit')
->setQueryParameter('foo', 'bar');
echo $url; // 'https://localhost/edit?foo=bar'
$url = new Url(
'http://john:xyz%[email protected]:8080/en/download?name=param#footer'
);
echo $url;
echo json_encode([$url]);
$url->isEqual('https://nette.org');
use Nette\Http\UrlImmutable;
$url = new UrlImmutable(
'http://john:xyz%[email protected]:8080/en/download?name=param#footer'
);
$newUrl = $url
->withUser('')
->withPassword('')
->withPath('/cs/');
echo $newUrl; // 'http://nette.org:8080/cs/?name=param#footer'
echo $url;
echo json_encode([$url]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.