Hi how to hide a url in the browser in the php, i need to pass username to all the pages like below
how can i reduce this please help me.
Thanks in advance
Hi how to hide a url in the browser in the php, i need to pass username to all the pages like below
how can i reduce this please help me.
Thanks in advance
It sounds like you want to use session handling.
hi laserlight
in the following code how can i do it
<?php
$firstname=$_GET['firstname'];
$lastname=$_GET['lastname'];
$username=$_GET['username'];
$session->logged_in = $_GET['logged_in'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Users List</title>
<link href="../Themes/DefaultTheme/Global.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
font-size: 16px;
}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style7 {color: #FFFFFF; font-weight: bold; }
.style8 { font-size: 14px;
font-weight: bold;
color: #FFFFFF;
}
-->
</style>
</head>
<body onLoad="<?php echo $onload; ?>" bgcolor="GREEN">
<center>
<!-- Use this Page Container to fix the page width -->
<div id="PageContainer">
<!-- Page Header begins -->
<div id="PageHeader">
<!--Use this PageTop for displaying user login information and user links -->
<div id="PageTop">
<table width="757" border="0">
<tr>
<td width="551">Login as :
<?php echo "<b>$firstname $lastname</b>"; ?>
<td width="121"><A
href="http://www.polkmarcom.com/login/change_password">Change Your Password</A> </td>
<td width="71">
<?php
/**
* User has already logged in, so display relavent links, including
* a link to the admin center if the user is an administrator.
*/
//print_r($session); die;
if($session->logged_in){
echo "[<a onClick=\"return confirm( 'Are you sure you wish to logout?' );\" href=\"../process.php\">Logout</a>]";
}
?>
</tr>
</table>
</div>
<!-- End of PageTop -->
<!--Use this HeaderLogoArea for displaying Logo -->
<div id="PageHeaderLogoArea"><img src="../Themes/DefaultTheme/Images/Header.gif" alt="" width="760" height="150" /></div>
<!--End of HeaderLogoArea -->
<!-- Page header bottom begins -->
<div id="PageHeaderBottom">
</div>
<!-- Page header bottom end -->
</div>
<!-- Page Header end -->
<!-- Page Body Begin -->
<div id="PageBody">
<div id="PageContentArea">
<table width="100%" height="100%" border="0">
<tr>
<td width="98%"><div id="PageContentHolder">
<!-- Any content that shows in content area must come in this div only -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="../quickcart.php">Home </a><strong>›› </strong><a href="admin.php?username=<?php echo $username.'&firstname='.$firstname.'&lastname='.$lastname.'&logged_in=1';?>">Administration</a> <strong>›› </strong>List of Users </td>
</tr>
<tr>
<td><form>
<table width="100%" border="0">
<tr>
<td width="11%"><a href="quickcart.php"></a></td>
<td width="3%"><a href="Datalist.php"></a></td>
<td width="6%"> </td>
<td width="47%"> </td>
<td width="33%"> </td>
</tr>
<tr bgcolor="#036DAD">
<td colspan="5" bgcolor="#036DAD"><span class="style8">Administrator Control Panel: Users List</span></td>
</tr>
<tr>
<td><strong><a href="Userinformation.php">Add New</a>:: </strong></td>
<td colspan="3"><div align="right">Page Numbers </div></td>
<td><?php
include "../views/Userpagecount.php"; ?> <a href="userslist.php"></a></td>
</tr>
</table>
<table width="100%" height="100%" cellpadding="3" cellspacing="0" bordercolor="#B2B2B2" bgcolor="#E6E6E6" class="FormField">
<tr>
<td width="1%" bgcolor="#036DAD"> </td>
<td width="4%" bgcolor="#036DAD"> </td>
<td width="4%" bgcolor="#036DAD"> </td>
<td width="13%" bgcolor="#036DAD"><span class="style7">Name</span></td>
<td width="25%" bgcolor="#036DAD"><span class="style7">Company</span></td>
<td width="38%" bgcolor="#036DAD"><span class="style7">Email</span></td>
<td width="15%" bgcolor="#036DAD"><span class="style7">ePace</span></td>
</tr>
<?php
function Display_users($pageno)
{
$_SESSION["userpageno"]=10;
include "../views/userview.php";
}
Display_users(10); ?>
</table>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div></td>
<td width="2%"> </td>
</tr>
</table>
</div>
</div>
<!-- Page Body End -->
<!-- Page Left Navigaion Area Begin-->
<div id="PageLeftArea">
<!-- Page Left Navigaion Begin-->
<div id="PageLeftMenu"><a href="contactus.php">Contact Us</a>
<a href="quickcart.php">Quick Catalog</a>
<a href="Datalist.php">Data List Manager</a>
<a href="Orders.php">Orders</a>
<a href="admin.php?username=<?php echo $username.'&firstname='.$firstname.'&lastname='.$lastname.'&logged_in=1';?>">Administration</a>
</div>
<!-- Page Left Navigaion End-->
</div>
<!-- Page Left Navigaion Area End-->
<!-- Page Footer Begin -->
<!-- End of Page Container <div> tag -->
</center>
</body>
</html>
It sounds like a VERY bad idea to authentificate a user via a GET variable ! Be careful, this code is very vulnerable. Don't you have a password for any user?
You would change $GET['example'] to $SESSION['example']