473,725 Members | 2,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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":

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?

-Bennett
Jul 17 '05 #1
2 7600

"Bennett Haselton" <be*****@peacef ire.org> wrote in message
news:e6******** *************** ***@posting.goo gle.com...
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
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?

-Bennett


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.


Jul 17 '05 #2
be*****@peacefi re.org (Bennett Haselton) wrote in message news:<e6******* *************** ****@posting.go ogle.com>...
I'm looking for a PHP tutorial that specializes in how to build sites
that are based around user logins.
<snip>
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?


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
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2371
by: doltharz | last post by:
Someone can point me to some good tutorial on building realtime multiuser interactive web pages? I prefer ASP/HTML but if there is no way, i'm open to Flash Java and Activex. By the way i prefer keeping it as mush "HTML" as possible. Thanks in advance I'm not a GURU nor an EXPERT or something like that. I'm just a passionnate programmer.
7
1539
by: Alf P. Steinbach | last post by:
I have to shop Christmas gifts (and clean up... ;-)) before leaving on Christmas holiday tomorrow, where I'll effectively be without a network connection until January 6th, so I just posted what I have so far -- which perhaps you'll find interesting! This is the third but unfinished part of what hopefully will become a technically _correct_ C++ newbie tutorial. <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_03.doc>.
15
4227
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is avaliable at... http://www.geocities.com/binnyva/code/javascript/advanced_tutorial/ If any of you could spare the time, please have a look at my tutorial
2
9873
by: Michael Mayer | last post by:
This is not an ad for the best c# tutorial on the internet! And not from anybody world known. I just wanted to start a thread (to possibly gather more interest) based on a post Jon Skeet made earlier: <quote from Jon Skeet - skeet@pobox.com > I'm considering writing a C# tutorial. Any comments (including "don't do it, there are plenty out there already") are welcome - and if I *do* go ahead with it, I'd love it to
4
7619
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax highlighting in C# but I have yet to find anything useful I know there are people at MS that know this stuff like the front of their hand and I know there are many people out on the web that are proficient in doing this as well but it seems nobody...
11
2933
by: Magnus Lycka | last post by:
While the official Python Tutorial has served its purpose well, keeping it up to date is hardly anyones top priority, and there are others who passionately create really good Python tutorials on the web. I think 'A Byte of Python' by Swaroop C H is a good beginners tutorial, and 'Dive Into Python' by Mark Pilgrim is a good tutorial for more experienced programmers.
9
4177
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be honest I usually hire someone to do it for me, grab predone scripts and kind of hack out the parts that I need, or just do very minimal validation (e.g. this is numeric, this is alpha-numeric, etc.)
19
2098
by: Clodoaldo Pinto Neto | last post by:
I'm just building a Python CGI Tutorial and would appreciate any feedback from the many experts in this list. Regards, Clodoaldo Pinto Neto
2
19342
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how we set about doing that. Every program starts with a specification, this may be a several hundred page document from your latest client or one small paragraph from your professor and pretty much anything in-between. The specification is very...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.