SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Aug 2000
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just need some direction on how I can allow viewers to choose what content will appear the next time they access my home page. For example on Yahoo you can select "entertainment headlines" or "top news headlines"; "top news photo" or "entertainment photo." Just a way for viewers to automatically select what they want to see when they access the homepage in the future.

    I've browsed a couple of advance web programming faqs (including the latest article here on Sitepoint) without finding what appeared to be an answer to my question.

    Any tutorials or intro articles would be a big plus.

    Much thanks ahead of time!

  2. #2
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In a way what you are wanting is something such as the SitePoint Forums which know which posts you have already read etc. This is called customisation and will involve you using cookies and using a database to store your information. To tell you the truth it is quite advanced and before you start messing with stuff liek that I suggest you learn HTML, then maybe some PHP and take it from there. I apologies if you already know that, but as you posted in the beginner's forum I assume that you are just that - a beginner!

  3. #3
    SitePoint Wizard big_al's Avatar
    Join Date
    May 2000
    Location
    Victoria, Australia
    Posts
    1,661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would use some form of scripting to do it, ASP or PHP would now a days be the most common ones, I'm unshore how you would go about it in Cold Fusion.

    You would create a login and registration type page where the user selects username password, and any particular things they would like to see when they next visit, then just put a cookie on there machine and your rockin' and rollin'


    If you can't find a tutorial for it I might think about doing one for ASP.

  4. #4
    SitePoint Addict
    Join Date
    Aug 2000
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know html (or at least enough to get a page up - I imagine one is never finished learning). I don't know php or asp.

    But why use a database? Couldn't I just set cookies on the users computer, then query their computer when they access the page as to what content should pop up? A data base and needing people to sign on would defeat some of the purposes. (I'd like to make it as easy for both me and them to customize their view of my home page.) I guess if I had to I would, but again isn't there an easier way?

    I'm not familiar with using cookies so some of my questions may sound a little dumb.

    Again, thanks ahead of time big al and Nicky (and anyone else who might post) for everyones help (particularly the quick responses).

    P.S. I posted to the beginners sections 'cause for this application I am a beginner! (also I kinda assumed this was an easy feat to accomplish...)

  5. #5
    SitePoint Wizard big_al's Avatar
    Join Date
    May 2000
    Location
    Victoria, Australia
    Posts
    1,661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why use a database?

    Ok, say you have a stock exchange related website.
    You would have a list of different stock options and companies on the stock exchange all in a nice little database (well not liitle if its to do with the stock exchange )

    Anyway....

    where was i? hehehe

    You can give a registered user the options to select what stock options and quotes they want to see when they come to your site.

    What you would do is give a list of the quotes and options and let the customer select what they want.

    You then would create a user profile in another database or table which would contain a refrance to the options he/she has selected.

    A cookie can then be put on his/her machine with refrance to the username and number.

    Everytime he/she then accesses the page, a script would search for that cookie and when it has found one it would lookup there prefrances in the database and display only the ones listed.

    Pheww thats all folks!

    Hope this has helped some.

    If you have anymore queries you can email me or just post some more questions

  6. #6
    SitePoint Addict
    Join Date
    Aug 2000
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I understand why if you were dealing with 35 million subscribers like Yahoo, or 12,000 stocks like the NYSE you _might_ want a database

    What I'm saying by "Why use a data base at all" is why would I take up my server space/megs of ram/time in upkeep/bandwidth/money with a data base if I could just store the user preference (not the actual info/date itself) on his home page?

    Say I wanna give viewers an opportunity to automatically load the joke of the day or the wise saying of the day upon access of my site. Couldn't I just have them select "joke" or "saying," then set a cookie on their computer. The next time the go to my page my site gets the cookie and loads the appropriate saying.

    Now I realize a data base would be great for storing/organizing ALL those jokes/sayings. But that's not what I'm struggling with. I just want to find the easiest way to find the viewers preference - not the actual data that preference is asking for.

    Again I don't know nothin' 'bout no cookies so I don't know how complicated this is, but if that would work wouldn't that same time (the user doesn't have to log on w/username & code, then wait for my server to grab the data from the data base, then access the data, then serve the data); I don't unnecessarily run a data base of user info that I don't really care about (I just want them to get whichever saying they want); and save time (both in online time for them and me and time in maintaining a data base).

    Remember, I'm just talking about somehow setting a preference for what info the viewer want's my server to display; I'm not talking about how I (the server) can organize/store/access whatever that data happens to be.

    Maybe I not explaining this very well. Anyhow, again, thanks for your patience, persistance and help.

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i suggest you to check http://php.net to use cookies with php. It works both on windows and linux servers so very portable, and learning curve is fast. And database stuff people mentioning is good for a big/growing site and makes life easier in the near future for you too. But it is not a must for you NOW.
    Good luck
    Great Dane
    Gokhan ARLI


Bookmarks

Posting Permissions

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