Click to See Complete Forum and Search --> : Redirect frame
zuzupus
06-16-2003, 09:08 AM
Hi,
How i can redirect frame using PHP as i want internal users to get below frame and for external different...
For internal users let say robin,jack are internal user in table t_emp where internal=true
-------------------------------------|
| | |
|Frame 1 | Frame 2 |
| | |
|------------------------------------|
| Frame 3 |
|------------------------------------|
and when internal=false
-------------------------------------|
| | |
|Frame 1 | Frame 2 |
| | |
| | |
| | |
|------------------------------------|
<? if (!$session->login) send_location_die('login.phtml?error=true'); ?>
<html>
<head>
<title>service </title>
</head>
<frameset framespacing="0" frameborder="0" border="0" rows="85%,15%">
//frame 1 and 2 only for externals
<FRAMESET cols="20%,80%*">
<frame src="Frame1" name="Frame1" scrolling="auto" />
<frame src="Frame2" name="Frame2" scrolling="auto" />
//frame 3 is only for internals
</FRAMESET>
<frame src="Frame3" name="Frame3" scrolling="auto" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
where should i put the code so that it will redirect for internal user i mean to say to get Frame 3 -----
Thanks
zuzupus
06-17-2003, 03:32 AM
how i can get the frames i mentioned above i am using code for login page
<tr>
<td align="center">
<h1>s t y l i n g a u t o m o t i v e i n d u s t r i a l e n g i n e e r i n g</h1>
<h2>welcome to the service page of</h2>
<p><a target="_blank" href="http://www.vitodesign.com/"><img src="../assets/vitodesign.gif" width="459" height="141" border="0" /></a></p>
</td>
</tr>
<tr><td> </td></tr>
<tr>
<td align="center">
<h1><span class="u">u s e r :</span><br />
<input size="20" maxlength="50" type="text" name="account" value="" class="big" /></h1>
<h1><span class="u">p a s s w o r d :</span><br />
<input size="20" maxlength="50" type="password" name="password" value="" class="big" /></h1>
<p><input type="submit" value="OK" class="biggray" /></p>
</td>
</tr>
and then for internal users it will get first figure else for external it will get fig.2
$query=select user from t_emp where intern='true';
then how to redirect as its not working by my logic..
A couple things. First of all, in your second post, you have no form tag, and thus you can have no action for you form....
Then, to get the frameset to change, based on the results, you will want to do something like this:
<? if (!$session->login) send_location_die('login.phtml?error=true');
if (something == true) { #enter your condition here
$loc = "somepage.php";
}
else {
$loc = "default.php"; #the default page, if the above is not true
}
?>
<html>
<head>
<title>service </title>
</head>
<frameset framespacing="0" frameborder="0" border="0" rows="85%,15%">
//frame 1 and 2 only for externals
<FRAMESET cols="20%,80%*">
<frame src="Frame1" name="Frame1" scrolling="auto" />
<frame src="Frame2" name="Frame2" scrolling="auto" />
//frame 3 is only for internals
</FRAMESET>
<frame src="<?PHP echo $loc; ?>" name="Frame3" scrolling="auto" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
zuzupus
06-17-2003, 08:56 AM
i try to use below code without using frames but still not geeting please help me :(
now i am using internal users for apple mango to get myphp.com but when i clcik on browser back button i see some default page dont no why---
index.html
<form action="login.php" method="post">
<table border="0" cellpadding="0" cellspacing="2" height="95%" width="100%">
<? if ($error) { ?>
<tr>
<td align="center" class="error">Der von Ihnen eingegebene Zugang existiert nicht oder das Paßwort ist inkorrekt</td>
</tr>
<? } ?>
<tr>
<td align="center">
<h1><span class="u">u s e r :</span><br />
<input size="20" maxlength="50" type="text" name="account" value="" class="big" /></h1>
<h1><span class="u">p a s s w o r d :</span><br />
<input size="20" maxlength="50" type="password" name="password" value="" class="big" /></h1>
<p><input type="submit" value="OK" class="biggray" /></p>
</td>
</tr>
</table>
</form>
login.php
<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<?
if($user){
if($user==mango){
?>
<script language="JavaScript">
location="myphp.com";
</script>
<?php
}elseif ($user==apple){
?>
<script language="JavaScript">
location="myphp.com";
</script>
<?php
}?>
<?php
}else{
?>
<script language="JavaScript">
location="default.com";
</script>
}
}
expire_header();
$session->login = false;
list($user) = once_query_array("SELECT user FROM t_user WHERE user = '".addslashes($account)."' AND password = '".addslashes($password)."'");
if (!$user) send_location_die('login.phtml?error=true');
$session->login = true;
$session->account = $user;
?>