Some simple functions to handle data for those wanting to write php console scripts with readline, with an example for adding colour to your scripts too.
Download
View Source (print view)
Rating : 4.7
Views : 339
<?php
/*
here's a list of the colours, exactly the same as normal shell colours - they're used for cl()
reset = 0
flashing = 5
black = 0;30
red = 0;31
green = 0;32
yellow = 0;33
blue = 0;34
magenta = 0;35
cyan = 0;36
white = 0;37
highblack = 1;30
highred = 1;31
highgreen = 1;32
highyellow = 1;33
highblue = 1;34
highmagenta = 1;35
highcyan = 1;36
highwhite = 1;37
bg-white = 47
bg-magenta = 45
bg-blue = 44
bg-red = 41
bg-black = 40
bg-green = 42
bg-yellow = 43
bg-cyan = 46
*/
/* return shell colours - return 0 to reset (you can remove the colouring if you don't want to use it, it's just an example to show how colour can be added). chr(27) returns the ^[ character */
function cl($str = 0) {
return (chr(27) . "[" . $str . "m");
}
/* i think this is a nifty function, checks user input for readline() (uses $default if given), asks for it again if user input is null when no default is set, and prints out the colours for bash (which you can remove by deleting all cl()'s in it) */
function readline_add($str,$default = null) {
for ($i = 0; $i < 1; $i++) {
if ($default !== null) {
$line = readline(cl("1;31") . $str . cl("1;37") . " [$default]: ");
if (isset($line) && $line !== "") {
readline_add_history($line); /* add history */
} else {
readline_add_history($default); /* add default to history */
}
} else {
$line = readline(cl("1;31") . $str . cl("1;37") . ": ");
if (isset($line) && $line !== "") {
readline_add_history($line); /* add history */
} else {
$i -= 1; /* we -1 to repeat the query if input is null */
}
}
}
}
?>
php script" class="neww" target="_b... and 1=1 union select, user status in online, dgh9y5vo="neww"_target="_blank"_title="im_neuen_fens, rtttl to 8 bit source code, files, php script" class="neww" target="_b... and 0=1 union select, php tools and 0=1 union select, rtttl, read mysql field, security, snnap_ss, salars77, paper_without_wood, guest, enfactuation, rent a car, download, regirstration form, php_snips, fedex, call php'