[PHP] re： [PHP] Include a B.php but not influence A.php
- Date: Fri, 20 May 2016 09:45:05 +0800
- From: "酷丁" <zsxx51@xxxxxxxxxx>
- Subject: [PHP] re： [PHP] Include a B.php but not influence A.php
Thanks for your answer.
Finally,I comment out the code in B.php that actually calls exit,and it work well.
On May 18, 2016, at 10:46 PM, Jigar Dhulla wrote:
> On Thu, May 19, 2016 at 6:56 AM, 酷丁 <zsxx51@xxxxxxxxxx> wrote:
>> a problem has troubled me for a long time,I have searched ,but
>> found the answer.
>> some thing like this:
>> include 'b.php';
>> echo 'test A.php';//because calling exit in b.php,so this can't be
>> exit("test B.php");
can you comment out portions of script for testing?
Try and find the code in B.php that actually calls exit
and comment it out.
If you don't need to include B.php at the top, put it after
echo 'test A.php'; //If code in A.php doesn't depend on B.php
Other wise it looks like you have situation that won't work regardless
of what you do with it.
>> I want to include b.php(b.php is a third library,but it will exit the
>> script) but no die.I try to find some function that can execute
>> b.php and
>> not die a.php ,but I can't.
>> are there any other method can do this?
> Libraries generally never die, they only have classes to include in
> project. According to me, it must be a full-fledged application/
> script, so
> what I can suggest is that you run the script externally. Means, if
> app is located at http://<your-domain>.com then that script can be
> or http://<your-domain>.com/<script>.
> After setting up like this you can make curl or ajax request to 3rd
> script URL to fetch the output.
> I personally do it that way. Hope this helps.
> Jigar Dhulla