Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2011
    Posts
    20
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Add session data to database... How to?

    Hi

    I am putting together an idea for my site.

    Its the 'planning' phase now, so any input is helpful.

    My plan is to have the site register the session to the database.

    I am looking to achieve this:

    • member joins at the sign up page.
    • if they visit again within 7 days, no '/test.jpg' page loads
    • if they visit on day 8, then '/test.jpg' loads, that is a Light Box.
    • if they visit for the first time since joining, and after there seven days, then the '/test.jpg' loads.
    • the '/test.jpg' page will only ever load once, not twice etc


    What would i need to register into the database? The unique 'username'? And the sign up date?

    Any ideas on where i could find a tutorial would be great... I need help for these:
    • register session into database for 'username', and 'sign up date'
    • php check the database and 'if true' or 'if false' then 'echo /test.jpg'?
    • then register to database that '/test.jpg' has loaded once
    • php check the database and 'if true' then never load '/test.jpg'


    If there is an easier way to achieve what i am looking for please let me know.

    I am an absolute beginner at this complex coding, so any php idea or tutorial is helpful, please assume i don't know anything so you can help.

    thanks
    steve

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    I use server side sessions, stored on the server. Then when I return to my website, it recognises my browser via the session data and then it compiles the page output accordingly.

    Just like when we return to this site after a few days; it doesn't require a login because it identifies your browser and loads according to the session data on the server.

    hth
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    New Coder
    Join Date
    May 2011
    Posts
    20
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hi

    thanks for your input, i am going to use a database entry...

    please see my post: http://www.codingforums.com/showthre...53#post1095453

    thanks
    steve


  •  

    Posting Permissions

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