Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-28-2011, 06:14 AM   PM User | #1
new_to_this
New Coder

 
Join Date: May 2011
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
new_to_this is an unknown quantity at this point
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
new_to_this is offline   Reply With Quote
Old 05-28-2011, 09:23 AM   PM User | #2
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
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
bazz is offline   Reply With Quote
Old 05-28-2011, 10:18 AM   PM User | #3
new_to_this
New Coder

 
Join Date: May 2011
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
new_to_this is an unknown quantity at this point
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
new_to_this is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:44 AM.


Advertisement
Log in to turn off these ads.