\n"; $url = 'http://www.psy.gla.ac.uk/~steve/tmp/z.php?var=asdf%3Cqwer'; //$url = preg_replace('/ /', '%20', $url); $buf = file_get_contents($url); if ($buf) { $s = 'succeeded'; } else { $s = 'failed'; }; echo "Fetch $s.
\n"; /* myurlencode: split at ? Any request part needs urlencode (sps to +) but main URL needs sp to %20 I.e. encode request separately at assembly; encode file part just with sp-trans FILENAME PART Raw html : allows sp, %20, &, &, <, %3C, < in filenames Fetch: can't take sp; or & or < or < allows %20, %3C, & in filename Header(): more liberal, but can't take < etc. Can take % codes. Full algo would be: (Split off request part and the ?) translate \ to / Decode & stuff split on / rawurlencode each part rejoin Full algo for request part: try urlencode it as a whole? How to stop re-coding % codes? Decode then encode? REQUEST PART Raw html: allows sp, +, %20, %3C can't allow &, &, <, <, as part of value Fetch: allows +, %20, %3C can't take sp, &, &, <, <, */ echo $buf; ?>

title

title2 xxx Last changed 28 Dec 2007 ............... Length about 900 words (6000 bytes).
(Document started on 28 Dec 2007.) This is a WWW document maintained by Steve Draper, installed at http://www.psy.gla.ac.uk/~steve/tmp/test1.html. You may copy it. How to refer to it.

Web site logical path: [www.psy.gla.ac.uk] [~steve] [tmp] [this page]

xxxx

By Steve Draper,   Department of Psychology,   University of Glasgow.

XXXX

Web site logical path: [www.psy.gla.ac.uk] [~steve] [tmp] [this page]
[Top of this page]
xxx Last changed 28 Dec 2007 ............... Length about 900 words (6000 bytes).
(Document started on 28 Dec 2007.) This is a WWW document maintained by Steve Draper, installed at http://www.psy.gla.ac.uk/~steve/tmp/test1.html. You may copy it. How to refer to it.

Web site logical path: [www.psy.gla.ac.uk] [~steve] [tmp] [this page]

xxxx

By Steve Draper,   Department of Psychology,   University of Glasgow.

XXXX

Web site logical path: [www.psy.gla.ac.uk] [~steve] [tmp] [this page]
[Top of this page]
REQUEST:
"; foreach ($_REQUEST as $key => $val) { echo "$key => $val
"; }; echo "

GET:
"; foreach ($_GET as $key => $val) { echo "$key => $val
"; }; echo "

POST:
"; foreach ($_POST as $key => $val) { echo "$key => $val
"; }; //phpinfo(); ?>


link
$cmd = 'date ';
$cmd =  'wtable < q.tab;';
$cmd = 'mydate 3';
system('(export PATH=.:/home/steve/bin:$PATH ;' .     $cmd     . ') 2>&1');
system("echo '$cmd'" . ';   2>&1');  worked
system('export PATH=.:$PATH ;    q;    2>&1');  Works!

system('csh -c  " set path = (. $path);      echo $path; " 2>&1');
system('$PATH = '.' $PATH;    echo $PATH;    2>&1');
system('ls -l ./q   2>&1');
system('cp /bin/date q  2>&1') ?> 
system('pwd 2>&1') ?>
system('echo $PATH 2>&1') ?>
system('ls -l q.php 2>&1') ?>
system('csh -c " echo hallo; " 2>&1'); ?>
system('./mydate 2>&1') ?>
Some code lumps Pretty print for arrays / structs: function pp($arr){ $retStr = ''; return $retStr; } // http://www.prettyprinter.de/ http://infohound.net/tidy/ http://qbnz.com/highlighter/ http://sourceforge.net/projects/geshi/files/