You are here: Re: How to open another page by PHP « All PHP « IT news, forums, messages
Re: How to open another page by PHP

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация