时时商务社区

标题: PHP用反撇号执行外部命令 [打印本页]

作者: bewin83    时间: 2018-2-14 05:46

            例如:
echo `whoami`;
// 导出数据库,要导入的文件夹必须要有可写权限, -u -p之后的内容必须要紧挨着写
[U]复制代码[/U] 代码如下:echo `mysqldump -h localhost -u$DbUser -p$DbPwd --default-character-set=utf8 $DbName > /var/$dumpFileName`;
反撇号其他用法
the server timestamp is: $result
";
  echo "";
  #使用shell_exec()
  $result1=shell_exec("date");
  echo "the server timestamp is: $result1
";
?>
输出结果如下:
the server timestamp is: 当前日期: 2009/06/30 二输入新日期: (年月日)
以上所述就是本文的全部内容了,希望大家能够喜欢。
            
            
您可能感兴趣的文章:
  • PHP 中执行系统外部命令
  • 在PHP中执行系统外部命令
  • PHP 执行系统外部命令 system() exec() passthru()
  • php外部执行命令函数用法小结
  • 浅谈PHP命令执行php文件需要注意的问题
  • linux系统下定时执行php脚本的方法
  • PHP在linux上执行外部命令的方法
  • 如何离线执行php任务
  • Ubuntu系统下用Crontab命令定时执行PHP文件详解
  • PHP编程实现脚本异步执行的方法
  • PHP实现执行外部程序的方法详解
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2