SSI:The Exec Directive

This directive is used to instruct the webserver to run an external application or a system command. #execs bear one of two forms

Running system commands via this directive is dangerous and is best avoided. Indeed, many site hosts block the use of the <!--#exec cmd=... form of this directive altogether. Typical examples of this directive are illustrated below

DirectiveMeaningOutput
<!--#exec cmd="ping explainth.at" --> Pings explainth.at Ping results
<!--#exec cmd="ls" --> Directory listing - use "dir" on Windows Directory listing
<!--#exec cgi="/scripts/myip.php" --> CGI script is run and results merged into HTML document Your IP address is 38.107.191.84
Jump To...

Colophon