Search
Left Quote    I start where the last man left off.
- Thomas A. Edison    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: User-Specific Pages
  This user is online  Guest
  Subject: "User-Specific Pages" Posted: @ 10:23 pm on Mar 20 2006   
Unregistered
I am reasonably new to PHP and MySQL, and I was wondering how I would go about redirecting people who login to my site to their specific page, with their specific data. I intend to have tutorials on the site available to people who have ordered the services related to the tutorials. The problem is, I want people to only be able to view the tutorials which they have purchased, etc. Is there a way to redirect them to a user-specific page after login? Thanks

    Viewed: 10,136 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: User-Specific Pages" Posted: @ 11:31 pm on Mar 20 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

yea, check out the Creating A Members System Tutorial - Login Code .

What you can do just redirect them to the tutorials url instead of redirecting them to the main page.

then, on your tutorials page run a query to display only tutorials by that username stored in the session variable: $_SESSION['use rname']

Add a column to your members table to store an array of tutorial id's they have purchased. Then on your tutorials page echo them out for the signed in member. see what i mean?




-bs0d | AllSyntax.com

    Viewed: 10,128 Times | Reply to This | To top
  This user is online  Guest
  Subject: "re: User-Specific Pages" Posted: @ 2:54 pm on Mar 21 2006    
Unregistered

Oh man! Is that ever easy! Here I've been, racking my brain trying to think of a way to get this to work, and there it is! Fantastic. Thank you. So I would just need to verify the session on the tutorial page and, if the session exists, echo the tutorial links via a sql query to the array on the table specifying which ones are available per that user, right? I for some reason had skipped over the ability to store arrays in tables. Thanks again!



    Viewed: 10,117 Times | Reply to This | To top
  This user is offline  misterhaan
  Subject: "re: User-Specific Pages" Posted: @ 3:23 pm on Mar 21 2006    

Member #: 5
Rank: User - (213)
Since: 02/11/05
Posts: 148
From: chair

speaking of storing arrays in tables, is there a better way than using php implode() to turn it into a string and store that in a varchar? i've been either doing that (like once or so) or creating a separate table just for linking two other tables (with two fields -- table1id and table2id)




please note that the above post is likely made up in its entirety.

    Viewed: 10,110 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: User-Specific Pages" Posted: @ 8:07 pm on Mar 21 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

 mister haan said...

< i>creating a separate table just for linking two other tables (with two fields -- table1id and table2id)


^^ That would probably be the easiest way. Im no expert, but it might come down to how many records or "id's&q uot; you're gonna be working with as to what method is best?




-bs0d | AllSyntax.com

    Viewed: 10,105 Times | Reply to This | To top
  This user is offline  David1159
  Subject: "re: User-Specific Pages" Posted: @ 4:18 am on Jun 24 2009    

Member #: 526
Rank: User - (81)
Since: 12/27/07
Posts: 81
From: usa

Just curious, good discussion too.

What if you need it to be dynamic? You have no set size of the array, you do not know how many tables would be needed.

Can't you save a object to the database if you serialize it? I haven't tried it in php though only java.




Coding is simply CST... Combining $hit Together. We make different $hit to run in unison correctly.

    Viewed: 7,013 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank