hi,
i want to get rid of these names in array as these names r coming from table t_user and there is boolean field name intern='t' for these users
if (isset($HTTP_POST_VARS['account'])){
$accounts = array("aa", "bb", "cc", "dd", "ee", "ff", "jj");
if (in_array($HTTP_POST_VARS['account'],$accounts)) {
header("Location:index.phtml");
}
else {
header("Location:index1.phtml");
}
}
i just dont want to mention these names is it possible to redirect the page without using hardcoded names
hope this is clear for everybody
regards
redirection
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
sorry mac for trouble
if (in_array($HTTP_POST_VARS['account'],$accounts)) {
header("Location:index.phtml");//having 3 frames for internal users
}
else {
header("Location:index1.phtml");//having 2 frames for external users
}
as this index1.phtml (2 frames)i used to redirect for external users is it possible that in index.phtml itself i show internal users for 3 frames and for externals 2 frames without writing diff. index1.phtml
regards
hope this clear
if (in_array($HTTP_POST_VARS['account'],$accounts)) {
header("Location:index.phtml");//having 3 frames for internal users
}
else {
header("Location:index1.phtml");//having 2 frames for external users
}
as this index1.phtml (2 frames)i used to redirect for external users is it possible that in index.phtml itself i show internal users for 3 frames and for externals 2 frames without writing diff. index1.phtml
regards
Code: Select all
//so when internal users login they will get this page and once_query_array
written in lib.php
<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<? if (!$session->login) send_location_die('login.phtml?error=true');
list($user) = once_query_array("SELECT user FROM t_user WHERE intern='t'");
if ($user) {
$loc = "log.phtml";
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<frameset framespacing="0" frameborder="0" border="0" rows="85%,15%">
<FRAMESET cols="20%,80%*">
<frame src="pane.phtml" name="pane" scrolling="auto" />
<frame src="blank.phtml" name="content" scrolling="auto" />
</FRAMESET>
<frame src="<?PHP echo $loc; ?>" name="log" scrolling="auto" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
//index1.phtml for external users //
<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<? if (!$session->login) send_location_die('login.phtml?error=true'); ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<frameset framespacing="0" frameborder="0" border="0" cols="220,*">
<frame src="pane.phtml" name="pane" scrolling="auto" />
<frame src="blank.phtml" name="content" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>hope this clear