Call another program from withing a program

From: Date: Thu, 20 Mar 2003 20:28:52 +0000
Subject: Call another program from withing a program
Groups: php.general 
Request: Send a blank email to php-general+get-140505@lists.php.net to get a copy of this message
I need to know if I am doing this the right way or if there is a better way to do this. Scenario, two programs. program_1.php and program_2.php. Based on case statement, program_1 could possibly call program 2. Example: switch ($page) { case '1': <call program_1.php script> break; case '2': do_some_stuff(); break; } The only way I could get that to work was to do a require/include or redirect. Example: Exmaple 1: switch ($page) { case '1': require "program_1.php"; exit; break; } Example 2: switch ($page) { case '1': print "<META HTTP-EQUIV='refresh' content='0;URL=program_1.php'>"; exit; break; } Is there a better way to do this? Thanks Kevin

« previous php.general (#140505) next »