PHP tutorial for building user-login sites

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bennett Haselton

    PHP tutorial for building user-login sites

    I'm looking for a PHP tutorial that specializes in how to build sites
    that are based around user logins. i.e. the user logs in on the front
    page, and are taken to a main login page where fields on the page are
    populated with values from some server-side database. Ideally, there
    would be a server-side "user" database table, with fields such as
    "age", so that you could insert a short tag in the PHP source like:

    Your age is: <?php [something goes here] ?>

    and the "age" value from the user table would be interpolated, such
    that the "[something goes here]" in the example above would be
    something short like "user.age", and not something clunky like an
    entire SQL query statement. (Preferably the database lookup of the
    user's record would be done just once per page load, or even once per
    user login, so that it wouldn't require a separate database query to
    populate every value on the page.) Also, ideally, a way to do queries
    against other tables in the server-side database, so you could have
    something in the page source like:

    Your ordered items are: <?php [whatever goes here] ?>

    which would query against another MySQL table like "orders" for orders
    whose user_id field matched the "ID" field of the user in your "user"
    table, and display the results in a table format according to some
    specified template. Again, it would be elegant if the stuff in
    "[whatever goes here]" could be brief (the bare minimum you'd need to
    specify would be the "orders" table and the name of the template that
    controls the formatting of the results), instead of having to be an
    entire SQL query.

    Can PHP do this? The first few sites that I found when searching for
    "PHP tutorial":



    Information about Enlightenment, a Window Manager for Linux, LaTeX, a text formatting system, GIMPS, the Great Internet Mersenne Prime Search, PHP, a server-side scripting language and computers in general. Spiced up with my daily stories and experiences.


    didn't talk much about building a user-login site like the one I'm
    describing. Is there a tutorial which specializes in how to build
    that kind of site with PHP?

    -Bennett
  • Guest's Avatar

    #2
    Re: PHP tutorial for building user-login sites


    "Bennett Haselton" <bennett@peacef ire.org> wrote in message
    news:e614455c.0 312131520.6e146 ec3@posting.goo gle.com...[color=blue]
    > I'm looking for a PHP tutorial that specializes in how to build sites
    > that are based around user logins. i.e. the user logs in on the front
    > page, and are taken to a main login page where fields on the page are
    > populated with values from some server-side database. Ideally, there
    > would be a server-side "user" database table, with fields such as
    > "age", so that you could insert a short tag in the PHP source like:
    >
    > Your age is: <?php [something goes here] ?>
    >
    > and the "age" value from the user table would be interpolated, such
    > that the "[something goes here]" in the example above would be
    > something short like "user.age", and not something clunky like an
    > entire SQL query statement. (Preferably the database lookup of the
    > user's record would be done just once per page load, or even once per
    > user login, so that it wouldn't require a separate database query to
    > populate every value on the page.) Also, ideally, a way to do queries
    > against other tables in the server-side database, so you could have
    > something in the page source like:
    >
    > Your ordered items are: <?php [whatever goes here] ?>
    >
    > which would query against another MySQL table like "orders" for orders
    > whose user_id field matched the "ID" field of the user in your "user"
    > table, and display the results in a table format according to some
    > specified template. Again, it would be elegant if the stuff in
    > "[whatever goes here]" could be brief (the bare minimum you'd need to
    > specify would be the "orders" table and the name of the template that
    > controls the formatting of the results), instead of having to be an
    > entire SQL query.
    >
    > Can PHP do this? The first few sites that I found when searching for
    > "PHP tutorial":
    >
    > http://www.php.net/tut.php
    >[/color]
    http://hotwired.lycos.com/webmonkey/...tutorial4.html[color=blue]
    > http://www.gimpster.com/wiki/PhpTutorial
    >
    > didn't talk much about building a user-login site like the one I'm
    > describing. Is there a tutorial which specializes in how to build
    > that kind of site with PHP?
    >
    > -Bennett[/color]

    Your description sounds unnecessarily difficult. I must be missing
    something.
    What is wrong with having the person log in - and then storing session
    variable $userID as $resultSet["userId"] ?
    userId is of course your unique field from your table -
    USERS(USERID,US ERNAME,PASSWORD ).
    You are then free to use this id wherever you want, with any sql syntax you
    want - simple or complicated.




    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: PHP tutorial for building user-login sites

      bennett@peacefi re.org (Bennett Haselton) wrote in message news:<e614455c. 0312131520.6e14 6ec3@posting.go ogle.com>...[color=blue]
      > I'm looking for a PHP tutorial that specializes in how to build sites
      > that are based around user logins.[/color]

      <snip>
      [color=blue]
      > Can PHP do this? The first few sites that I found when searching for
      > "PHP tutorial":
      >
      > http://www.php.net/tut.php
      > http://hotwired.lycos.com/webmonkey/...tutorial4.html
      > http://www.gimpster.com/wiki/PhpTutorial
      >
      > didn't talk much about building a user-login site like the one I'm
      > describing. Is there a tutorial which specializes in how to build
      > that kind of site with PHP?[/color]

      1. http://www.google.com/search?&q=php+login+script
      2. http://martin.f2o.org/php/login

      --
      "Silence is the only right answer for many wrong questions" --
      G.K.Moopanar, Politician
      Email: rrjanbiah-at-Y!com

      Comment

      Working...