Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on need help (php session) within the PHP forums, part of the Web Development category; i start a new session with : session_start(); then i set some session variable like this : $_SESSION['name']=$_POST['name'];\ and some another variables. at bottom of page i set header to ...
|
|||||||
| PHP PHP - The most popular scripting language. Discuss PHP related questions here. Sample Scripts, Popular downloads, tools and utilites and more... |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
need help (php session)
i start a new session with : session_start();
then i set some session variable like this : $_SESSION['name']=$_POST['name'];\ and some another variables. at bottom of page i set header to diffrent page : header('location: index.php'); exit(); now in new page (index.php i can't access to my session variables, like $_SESSION['name']) what's wrong ? thanks. here is my files : a.php ======================================== session_start(); require ('config.inc.php'); if(isset($_POST)) foreach($_POST as $v=>$k) { $items[$v]=$k; } $sql="SELECT * FROM members WHERE username='{$items['user']}' AND pass=MD5('{$items['Password']}') "; $res=mysql_query($sql); $row=mysql_fetch_assoc($res); if($row['username']) { $_SESSION['type']=$row['type']; $_SESSION['name']=$row['name']; $_SESSION['family']=$row['family']; $_SESSION['username']=$row['username']; $_SESSION['date']=$row['date']; } header('location: admin.php'); exit(); ====================================== admin.php ===================================== <?php session_start(); if(!isset($_SESSION['admin'])) { header('location: index.php'); exit(); } require ('config.inc.php'); ?> . . . ================================= |
| Sponsored Links |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Session | dnt9862 | VB.NET | 1 | 08-21-2009 04:03 AM |
| Session Variables | C D Raghavendra | ASP.NET | 1 | 08-04-2008 02:48 AM |
| bdc session method | b_geetha04 | SAP R/3 | 1 | 06-07-2008 01:06 PM |
| Kill a session | krishnaindia2007 | Oracle | 2 | 12-01-2007 01:21 AM |
| plain asp session | rumbleEye | ASP.NET | 1 | 11-14-2007 03:31 AM |