473,666 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3674
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 fefsensmrrjyahe eoceoq\! | 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.go ogle.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
2168
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 etc.) Anks
2
2569
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 the Remote_Host, UserHostAddress, and UserHostname. I am unclear as to whether the Remote_Host and UserHostAddress are the same thing and what exactly the UserHostName signifies. I have checked many resources, but can't seem to get clear on...
1
5336
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 works except that I have two warning nuisances: 1) Program is trying to access email Addresses you have stored in Outlook. Allow access for ... 2) A program is trying to automatically send email on your behalf ... Heck, I am only trying to a send...
4
4809
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 session immediately when the user closes the browser. Does anyone know a way of doing this? -- Thanks,
1
2789
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 the problem is that sometimes the user still closing their browser window by clicking on the "x" button of the window. This is quite a problem for us because it will leave unreleased resource on the server for an unpredictable period of time,...
5
2565
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 value of /data/valid/string1 (The name seised by the user) and alert the name as result Can you help me to achieve this? <?xml version="1.0" encoding="UTF-8"?>
4
13065
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 something running in the background. There are option such as having the form invisible (opacity set to zero) and settings it's location as -200, -200 so that it isn't on the screen, but this isn't the ideal solution.
3
8284
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 where it confirms the session name before continuing..problem is when data is validated and redirection is done to different page,it gives an error that object is no longer valid.. some part of code... login.asp::: strSQL="SELECT * FROM...
4
7909
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 the user is requesting. Regardless of where they go, they are prompted to login...but I want the initial login page to capture where they have REQUESTED to go and store it somewhere (I assume a cookie).
0
8440
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
8863
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...
0
7378
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6189
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
4192
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
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1763
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.