Posted by Stefan Mueller on 02/02/06 16:59
> if (!$_SESSION['my_session_variableberechtigung']) //not set
> {
> include('login.php');
> }
> else
> {
> whatever
> }
Good idea, but does 'include' not include the whole file before it starts
executing the code?
If yes it would mean that each file would be include before it starts
executing.
<?php
switch ($my_var) {
case 1:
include('file1.php');
break;
case 2:
include('file2.php');
break;
case 3:
include('file3.php');
break;
case 4:
include('file4.php');
break;
...
}
?>
And my second concern is that it's not working if the file name is not
defined at the beginning.
<?php
...
$my_application = "file" . $my_var;
...
include($my_application);
...
?>
I think regarding these two statements
header("Location: login.php");
resp.
header("Location: file" . $my_var);
would be the better choice.
Or am I wrong?
Is there really no command which executes another PHP file just in time?
Stefan
[Back to original message]
|