PHP用反撇号执行外部命令

normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(17,17,17); font: 12px/18px Tahoma,Arial,'Microsoft YaHei',Simsun; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px">例如:

normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(17,255); text-indent: 0px; -webkit-text-stroke-width: 0px">echo `whoami`;

normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(17,255); text-indent: 0px; -webkit-text-stroke-width: 0px">// 导出数据库,要导入的文件夹必须要有可写权限,-u -p之后的内容必须要紧挨着写

normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(17,255); text-indent: 0px; -webkit-text-stroke-width: 0px">

代码如下:
/var/$dumpFileName`;

normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(17,255); text-indent: 0px; -webkit-text-stroke-width: 0px">反撇号其他用法

rush:PHP;"> PHP #使用反撇号,暗示作为命令来执行 $result=`date`; echo "

the server timestamp is: $result

";

echo "


";

使用shell_exec()

$result1=shell_exec("date");
echo "

the server timestamp is: $result1

";
?>

normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(17,255); text-indent: 0px; -webkit-text-stroke-width: 0px">输出结果如下: the server timestamp is: 当前日期: 2009/06/30 二输入新日期: (年月日)

以上所述就是本文的全部内容了,希望大家能够喜欢。

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...