473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to capture and valid user session

Hi,

I just build a website and need to somehow trap the user logon and

1) display 'welcome! so and so' at the left hand corner of the page.
2) valid whether the user exists in my MySQL database, user table.

How do I do that?

Thanks for your help!
Jul 17 '05 #1
3 3661
On 2003-12-08, xo55ox <xo****@hotmail.com> wrote:
Hi,

I just build a website and need to somehow trap the user logon and

1) display 'welcome! so and so' at the left hand corner of the page.
2) valid whether the user exists in my MySQL database, user table.


You could start with reading the manual at http://www.php.net/manual/nl

Looking at the source-code of phpmyadmin will give you an example howto
code this. Buf if you have read, and understood the manual, i think
you'll be able to come up with this basic stuff yourself.

--
verum ipsum factum
Jul 17 '05 #2
xo55ox wrote:
Hi,

I just build a website and need to somehow trap the user logon and

1) display 'welcome! so and so' at the left hand corner of the page.
2) valid whether the user exists in my MySQL database, user table.


You could see the section in the manual on 'HTTP authentication with
PHP', but I think that method is clunky and annoying, especially if you
are testing a script and need to login and logout of different accounts.

Instead, I use cookies to store the username and password. It's not
secure, but my ISP does not offer SSL, so nothing I run will be secure.
However, make sure to offer an option of session-only logins by setting
no expiry date for the cookie. That way, once the browser is closed, the
cookie is deleted (or marked for deletion). Supposedly. The problem with
cookies is their client-side nature - you have to rely on the browser to
do its job properly.

You seem very new to PHP, and your questions can't easily be answered in
a usenet group. I recommend you go and find as many example PHP scripts
as you can, and see how they handle authentication of users.
--
Bob
London, UK
echo Mail fefsensmrrjyaheeoceoq\! | tr "jefroq\!" "@obe.uk"
Jul 17 '05 #3
Hi,

Easiest way is to set a cookie when the user has logged on. When he
returns (or after logon) check the logon information (and retrieve the
name) in the mysql database by doing a query on your user table.
xo****@hotmail.com (xo55ox) wrote in message news:<ab**************************@posting.google. com>...
Hi,

I just build a website and need to somehow trap the user logon and

1) display 'welcome! so and so' at the left hand corner of the page.
2) valid whether the user exists in my MySQL database, user table.

How do I do that?

Thanks for your help!

Jul 17 '05 #4

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

Similar topics

1
by: anks | last post by:
I am using jsp for my web based application. All participants enter through login password provided to them. Is it possible to capture the session status information(connected, disconnected time...
2
by: Hugh McLaughlin | last post by:
Hello everyone and thanks for your help in advance. I am working on an application to track visitors to my website. However, I am confused as to what data to capture for the session, specifically...
1
by: Jay McGrath | last post by:
Help - trying to send a simple text email with with as little user intervention. I am trying to create a button in my Access application that will automatically send a simple text email. It...
4
by: Bill Manring | last post by:
I need to capture the event when the user closes the browser in my application. I have some code in the session_End event, which works fine when the session times out, but I need to end the...
1
by: Feng | last post by:
Hi, Need help on the following issue. We need to clean up some session specific backend resource when a user ends his session. We have a "Logoff" button on the pages that handles that. But...
5
by: sniper | last post by:
hi ; i have this small code that consist in taking the name of the user and writing it in the same form as an output.the name is relative to /data/valid/string1 In my Js code i want to access the...
4
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
I know how to capture a keypress for a windows application, but how would I go about doing it for a windows service? Rather than having a form in focus all the time, I would prefer to have...
3
by: xpertbyshishir | last post by:
i m trying to execute a simple code which uses login information ..and after validating data (ie username and password) it stores these values in session objects and redirects to a different page...
4
by: DGS | last post by:
Hi guys, Not a developer, but an admin so please pardon my ignorance. I have an issue that I was hoping to get help with. What I need is for the front page of my site to capture the URL that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.