473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Session data not passing to the next page

11
I hope it's OK to tag my question on to the end of your response?
I am struggling to carry variables through to the next page using sessions. I have the following:-
Expand|Select|Wrap|Line Numbers
  1. $result = mysql_query("SELECT `email`,`first_name`,`last_name`,'registered_on' FROM `wsd_members` WHERE `username`= '" . prepareData($_POST['username']) . "' and password = MD5('" . prepareData($_POST['password']) . "')");
  2.       if ($result) {
  3.         if ($frow = mysql_fetch_row($result)) {
  4.           $email = $frow[0];
  5.           mysql_query("UPDATE wsd_members SET last_logged_on = NOW() WHERE username = '" . prepareData($_POST['username']) . "'");
  6.           session_start('MEMBERS');
  7.           $_SESSION['username'] = stripData($_POST['username']);
  8.           $_SESSION['email'] = $email;
  9.           $_SESSION['first_name'] = $first_name;
  10.           $_SESSION['last_name'] = $last_name;
  11.           $_SESSION['registered_on'] = $registered_on;
  12.           session_write_close();
  13. // landing page
  14.           header("Location: http://www.xx.co.uk/folderdb/members/index.php");
  15.           exit(); 
  16.         }
  17.         else {
  18.           $error = 'Invalid username or password';
  19.  
My problem is that I can see username and email but I am not seeing the others.
Can you see anything in my code that could be causing my problems?
Mar 7 '08 #1
2 2081
bobf
11
Resolved
Sorry Guys it was under my nose
Expand|Select|Wrap|Line Numbers
  1. if ($result) {
  2.     if ($frow = mysql_fetch_row($result)) {
  3.       $email = $frow[0];
  4.       $first_name = $frow[1];
  5.       $last_name = $frow[2];
  6. etc.....
  7.  
I think it is asking for help that gets my brain in gear!!
Mar 7 '08 #2
Atli
5,058 Expert 4TB
Hi.

I've split your question into it's own thread so it doesn't get mixed up with the responses to the Article.

Glad you found the problem. If I had a dollar every time I overlooked some minor detail like that I'd probably be a millionaire by now :)

Good luck with your project and feel free to post a new topic if you run into any more trouble.
Mar 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
4
by: Arnaud | last post by:
Hi ! I would like to propagate data between php pages, in two cases : the pages are read by : 1- Internet Explorer It's ok, data are writen in one page, and read from another. I don't use...
27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
4
by: bateman | last post by:
Hi, I have a rather puzzling problem, have asked the ASP experts at work with no joy and its driving me mad! I'll explain the steps in more detail below but the general problem is I am manually...
1
by: Carl Gilbert | last post by:
Hi I would like to know that best way of adding data to the session state object. I have a page with a series of links such as: designs.aspx?categoryID=1 designs.aspx?categoryID=2 When I...
3
by: ESmith | last post by:
I have multi-page form where I pass an object between pages as follows: On each page: // What page to go to next private void btnContinue_Click(object sender, System.EventArgs e) { if...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
17
by: Riaan | last post by:
Hi guys! I have an issue that needs urgent resolution. Imagine this scenario: You have: 1 production server running Windows Server 2003, IIS6 and an instance of MSDE 2000. There is an...
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.