SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Making

  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making

    Hi thinking about making a site gaming type , how do i make a page to load first that asks users their age and subject to the answer allow them to gain access? nothing rude or ilegal just dont want under 13s to access site ,

  2. #2
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This can be achieved using session.

    in PHP.
    you can include on .PHP file at the top of all your pages that checked if the session (this will be set if the age is higher than 13) is available. If it is not available then you can redirect your user to the question page (ask age there). If the entered age is higher than 13, you can set the session variable.

    in ASP.NET
    You can check the same session in the Page_Load events of all your pages. If the session is not available, you can redirect user to enter the age. if the age is ok, you can set the session.

    You can also use Cookies instead of session. The basic mechanism remains the same.


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
  •