PHP: escapeshellcmd - Manual in Deutsh
PHP: escapeshellcmd - Manual in French
PHP: escapeshellcmd - Manual in Polish

You Are At PHP: escapeshellcmd - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

escapeshellcmd

(PHP 3, PHP 4, PHP 5)

escapeshellcmd -- Escape shell metacharacters

Description

string escapeshellcmd ( string command )

escapeshellcmd() escapes any characters in a string that might be used to trick a shell command into executing arbitrary commands. This function should be used to make sure that any data coming from user input is escaped before this data is passed to the exec() or system() functions, or to the backtick operator.

Following characters are preceded by a backslash: #&;`|*?~<>^()[]{}$\, \x0A and \xFF. ' and " are escaped only if they are not paired. In Windows, all these characters plus % are replaced by a space instead.

Parameters

command

The command that will be escaped.

Return Values

The escaped string.

Examples

Example 1. escapeshellcmd() example

<?php
$e
= escapeshellcmd($userinput);

// here we don't care if $e has spaces
system("echo $e");
$f = escapeshellcmd($filename);

// and here we do, so we use quotes
system("touch \"/tmp/$f\"; ls -l \"/tmp/$f\"");
?>

See Also

escapeshellarg()
exec()
popen()
system()
backtick operator

wiza do rosji, hurtownia odzieży, powiększanie ust, sukienki do tańca dla dzieci, leczenie uzależnień, sztućce, kursy angielskiego wrocław, obsługa klienta, Kodeki Download, Pink Elephant
kuchnia seo Bezpieczne osiedle CA Personal Firewall lunety

Another Useful functions:


function.sqlite-escape-string | function.pg-unescape-bytea | function.pg-escape-string | function.pg-escape-bytea | function.mysqli-real-escape-string | function.mysqli-escape-string | function.mysql-real-escape-string | function.mysql-escape-string | function.maxdb-real-escape-string | function.maxdb-escape-string | function.ircg-nickname-unescape | function.ircg-nickname-escape | function.escapeshellcmd | function.escapeshellarg | function.dbx-escape-string |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.