Re: Run or execute a php cript within a php cript.
| From: | Steve Edberg | Date: | Fri, 21 Sep 2001 07:01:38 +0000 |
| Subject: | Re: Run or execute a php cript within a php cript. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68111@lists.php.net to get a copy of this message | ||
You can do something like
<?php
# Master script
switch ($Something) {
case 1:
include 'xx1.php';
break;
case 2:
include 'xx2.php';
break;
# ...and so on
}
# ...include any 'post-processing PHP stuff here, if necessary
?>
Any variables in the master script's scope are in the scope of the included files as well.
If you want to actually REDIRECT the user to another page, you can use the header function to send a Location: header. See
http://www.php.net/manual/en/control-structures.switch.php
http://www.php.net/manual/en/function.include.php
http://www.php.net/manual/en/function.header.php
for more information.
-steve
At 8:46 AM +0200 9/21/01, hvm wrote:
Hi all. Is there a command to execute (run) from HTML or a php4 script a other php script without a mouse click (<A HREF=xx.php>). I have a lot of php scripts and need them to execute from a master php script. any help? Thanks all, Yours Hans.-- +------------------------ Open source questions? ------------------------+ | Steve Edberg University of California, Davis | | sbedberg@ucdavis.edu Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +----------- http://pgfsun.ucdavis.edu/open-source-tools.html -----------+