Home  >  Article  >  Backend Development  >  php里面的if添加php调用能执行吗?解决方案

php里面的if添加php调用能执行吗?解决方案

WBOY
WBOYOriginal
2016-06-13 13:40:20992browse

php里面的if添加php调用能执行吗?
我的PHP源代码里面有一个if的,
例如在if里面留言成功,就显示:留言添加成功,我想添加一个执行PHP的执行文件,全是直接打开就是一个执行的PHP,在里面能否调用PHP?如何写这个,是使用include还是什么?能否直接让留言成功弹出窗口后就再执行我指定的PHP文件呢?


源文件:

if($result == 1)

{

ShowMsg("留言添加成功");
我想在这里添加执行的php文件;

}

else

{

ShowMsg("留言添加失败");

}


------解决方案--------------------

PHP code

if($result == 1){
  ShowMsg("留言添加成功");
  exec("c:\path\php phpinfo");
}else{
  ShowMsg("留言添加失败");
}
<br><font color="#e78608">------解决方案--------------------</font><br>if($result == 1){<br><br>include("http://www.xxxx.com/test/testemail.php");  <br>ShowMsg("留言添加成功");<br>   <br>}else{<br> ShowMsg("留言添加失败");<br>}
<br><font color="#e78608">------解决方案--------------------</font><br>我都是require_once 'xxx.php'; 文件路径不要写错了。 <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn