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"