Can I execute a php call to add the php if file in php? Solution

Source: Internet
Author: User
Can I execute a php call to add the php if file in php? In my PHP source code, there is an if. for example, if the message is successfully added, the message is displayed: The message is successfully added. I want to add an execution file for PHP execution, directly open is an executed PHP. can PHP be called in it? How to write this, whether to use include or what? Can I directly enable the message to pop up and then execute the php file I specified? Can I execute the if add php call in source php?
In my PHP source code, there is an if,
For example, if the message is successfully added, the message is displayed as follows: I want to add an execution file for executing PHP, which is directly opened as a PHP execution file. Can I call PHP in it? How to write this, whether to use include or what? Can I directly enable the message to pop up and then execute the php file I specified?


Source File:

If ($ result = 1)

{

ShowMsg ("message added successfully ");
I want to add the php file for execution here;

}

Else

{

ShowMsg ("failed to add Message ");

}


------ Solution --------------------
PHP code
If ($ result = 1) {ShowMsg ("message added successfully"); exec ("c: \ path \ php phpinfo ");} else {ShowMsg ("failed to add Message ");}
------ Solution --------------------
If ($ result = 1 ){

Include ("http://www.xxxx.com/test/testemail.php ");
ShowMsg ("message added successfully ");

} Else {
ShowMsg ("failed to add Message ");
}
------ Solution --------------------
I use require_once 'XXX. php'. do not write an error in the file path.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.