note 116023 added to features.commandline
| From: | frankNospamwantedat.toppointdot.de | Date: | Thu, 30 Oct 2014 15:37:25 +0000 |
| Subject: | note 116023 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200751@lists.php.net to get a copy of this message | ||
Parsing commandline argument GET String without changing the PHP script (linux shell):
URL: index.php?a=1&b=2
Result: output.html
echo "" | php -R 'include("index.php");' -B 'parse_str($argv[1],
$_GET);' 'a=1&b=2' >output.html
(no need to change php.ini)
You can put this
echo "" | php -R 'include("'$1'");' -B
'parse_str($argv[1], $_GET);' "$2"
in a bash script "php_get" to use it like this:
php_get index.php 'a=1&b=2' >output.html
or directed to text browser...
php_get index.php 'a=1&b=2' |w3m -T text/html
----
Server IP: 72.52.91.14
Probable Submitter: 86.103.201.184
----
Manual Page -- http://php.net/manual/en/features.commandline.php
Edit -- https://master.php.net/note/edit/116023
Del: integrated -- https://master.php.net/note/delete/116023/integrated
Del: useless -- https://master.php.net/note/delete/116023/useless
Del: bad code -- https://master.php.net/note/delete/116023/bad+code
Del: spam -- https://master.php.net/note/delete/116023/spam
Del: non-english -- https://master.php.net/note/delete/116023/non-english
Del: in docs -- https://master.php.net/note/delete/116023/in+docs
Del: other reasons-- https://master.php.net/note/delete/116023
Reject -- https://master.php.net/note/reject/116023
Search -- https://master.php.net/manage/user-notes.php