dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: PHP Session to store user data across pages

  1. #1
    Join Date
    Sep 2010
    Posts
    36

    PHP Session to store user data across pages

    Hi there,

    I have an online ordering page where users input there data (name, number, address etc). Just before the user clicks "Pay", there is a box where they must tick to accept my terms and conditions. There is also a link to view my terms however if they click this, when they return to the ordering page (using the back button on the browser or by a link at the bottom) the data they have typed is gone.

    I have read about using variable sessions to store the data across pages.

    Is this the best route to go down?

    Thanks very much for reading and for any help offered.

    Kind regards, Mike

  2. #2
    Join Date
    May 2010
    Location
    Manila, Philippines
    Posts
    189
    Probably you can use session variables to keep those data. But I think it would be a workload for you. I suggest to open a new page once the terms have been click. Just like this one https://www.google.com/accounts/NewA...aaf4f4c&type=2

  3. #3
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    There is also a link to view my terms however if they click this, when they return to the ordering page (using the back button on the browser or by a link at the bottom) the data they have typed is gone.
    Make the link target="_blank"

    about 10 times easier. I guess you could use a session, but you'd have to use some ajax and onchange/focus tags for your elements.

    If you're storing sensitive data in a session, I would suggest you change the path to something you can control. That way other users are not reading the data you store in your session or hijacking the sessions that belong to your users (if you're on a shared host). It's not uncommon for shared hosts to be configured where the session is saved to a publicly readable directory by default.
    Last edited by eval(BadCode); 03-02-2011 at 10:31 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles