Re: newbie question about one php script passing control to another

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 20, 2008 at 12:08:39PM -0400, Rod Clay wrote:
> Hello.  I am new to php programming, but have spent many years
> programming in many other languages, most recently perl (with which
> php  seems to have much in common!).  In every other language I've
> worked  with there is a way for one program to pass control to
> another.   However, so far in all of the books and other documentation
> I've looked  at for php, I cannot find a way for one php program to
> pass control to  another.  Is this possible in php, and, if so, please
> let me know how.   Thank you.

This may be what you are looking for:

include('next_program');
exit();

If you do this, you have to keep in mind that all the variables you set
in the first program are *still* set in the second.

This is useful when your first program needs to choose which of two or
more programs to run next depending on its calculations. For example, if
your first program does error checking then it might want to run an
all_ok program or an edit program.

-- 
"To be without a plan is the true genius and glory of the antislavery
 movement. The mission of that movement is to preach eternal truths, and
 to  bear witness to everlasting testimony against the giant falsehoods
 which bewitch and enslave the land." -- Nathaniel Peabody Rogers
    Rick Pasotto    rick@xxxxxxxx    http://www.niof.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux