[PHP] How to make program execution go to another file?

2004-05-20 Thread michael young
Hi,
  I want program execution to go to one of several other files 
based on a decision.
For Example.

if (1==a)
  go to this .php file
if (1==b)
  go to that .php file
if (1==c)
  go to the other .php file
Thank you for your time.
  Michael
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to make program execution go to another file?

2004-05-21 Thread michael young
Thank you for your help.
This should do nicely.
Michael
Vail, Warren wrote:
This is a common problem for people coming from other languages where the
file structures are the same as the execution structure.  A few of at least
50 answers is as follows;
Force the browser to invoke your next program;
If(1==a) {
header("Location: this.php");
 exit;  //stop this script
}
If(1==b) {
 header("Location: that.php");
exit;
}
If(1==c) {
header("Location: other.php");
}
Another option would be to take advantage of conditional includes to bring
the code into the current script;
If(1==a) {
   include("this.php");
   exit;
}
If(1==b) {
include("that.php");
exit;
}
If(1==c) {
include("other.php");
}
Include will issue a warning if executed and the file does not exist.
Require is fatal if executed and the file does not exist.
You can, of course use;
if(file_exists("this.php")) include("this.php"); 

to suppress any warning at all.

Warren Vail
-Original Message-
From: michael young [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 20, 2004 2:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to make program execution go to another file?

Hi,
  I want program execution to go to one of several other files 
based on a decision.
For Example.

if (1==a)
  go to this .php file
if (1==b)
  go to that .php file
if (1==c)
  go to the other .php file
Thank you for your time.
  Michael
 

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


[PHP] clearing new pages

2004-05-26 Thread michael young
Hi,
a file called a.php prints "hello" to the browser then calls b.php 
which prints "goodbye" to the browser.
the output looks like this:

hello
goodbye
how do I clear the screen so the end results looks like this:
goodbye
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php