473,511 Members | 11,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php user greeting

27 New Member
hi
i have a login database which has got usernames and passwords.NOw when i logs in i want a geetings from the server side like "Welcome $user" and also a logout link. i am talking abt the way bytes forum greets the user.
LIke when the user logsin the forum page 's top the username (logout) appears.I need a php script.
Anyone plz help me.
Thanx in advance
Oct 22 '08 #1
5 1606
Atli
5,058 Recognized Expert Expert
Hi.

What have you tried so far?

We are always happy to help, but we are not about to do your work for you. You are at least going to have to try it yourself, and if you run into something you need help with, we will need to know what you are doing and how it isn't working. Error messages and code samples are very helpful to.
Oct 22 '08 #2
Markus
6,050 Recognized Expert Expert
1. You get the data from the database and display it.

2. When a user logs in, you must be setting a session or cookie. Therefore, to log the user out, simply destroy the cookie or session.
Oct 22 '08 #3
JDBurnZ
3 New Member
sreenisha, what you're asking is a rather complicated question and requires a rather complicated answer.

Markus is right, you're going to need to interact with a database to compare user name and password against. If the information matches, you'll want to save a piece of authentication information in their browser called a cookie.

Next, on the pages you want to display this welcome block, you'll check for the cookie, make sure it's valid (by comparing it with the database,) and then display the block.

If you want me to give you a simply example just get a hold of me and I'll write up something simple for you to get you on your way! :)
Oct 23 '08 #4
Atli
5,058 Recognized Expert Expert
If you want me to give you a simply example just get a hold of me and I'll write up something simple for you to get you on your way! :)
JDBurnZ.

Please do not offer programming help through emails or private messages. Help offered on the forum is better because it benefits everyone else facing similar problems. (See How To Respond To A Question).

Having said that, I actually wrote an example as a part of my PHP Session HowTo that might help. It's very simple but might help point in the right direction.
Oct 23 '08 #5
sreenisha
27 New Member
Thank u all.
I got the output the way i want.I prepared a detailed note abt sessions and cookies and learnt that.Then i managed to get the output.Once again thanks for all necessary informations provided for me.
Oct 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4182
by: Jack David | last post by:
I have a number of web user controls that I want to be able to load into a page. I want to be able to define what controls to include in the page, and what order they should appear in. I am using...
5
2215
by: kw | last post by:
Hello, I am trying to put up a page for my students for them to be able to enter their class number into a field and instantly get a personalized text message. (ie student number 5 enters "5"...
4
1316
by: Leon | last post by:
I have 10 .aspx pages within my web application and would like to know what is the best way I can write code within my header user control so that the greeting message change for each page the user...
17
1615
by: hanumizzle | last post by:
I have used Perl for a long time, but I am something of an experimental person and mean to try something new. Most of my 'work' with Vector Linux entails the use of Perl (a bit of a misnomer as it...
4
1597
by: rpapaiof | last post by:
i have designed a login page in this form <?php if ( $_POST && $_POST && $_POST) { $a=file("file.txt"); foreach($a as $k => $v) { $b=trim($v); } #echo "<pre>"; print_r($b); echo "</pre>";...
0
2710
by: All-Yours Greetings | last post by:
<HTML><HEAD><TITLE>all-yours.net</TITLE> <META NAME="a"> <METAA NAME="description" content="a"> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <META content="MSHTML...
3
3850
by: tkaw220 | last post by:
Hi, I am looking to build an PHP application which will automatically send birthday greeting email to subscribers. The content of that email will change from time to time. Please help. Links to...
1
1575
by: ielamrani | last post by:
Hi All, First of all Happy Holidays. We usually do this piece manually. I want to find out if it's possible to send a Greeting card (Outlook card) to all our clients using their email address that...
1
1811
by: jock1up | last post by:
Having a problem and have tried to rework the code and check for errors, but still isn't showing right on my brower. Have also viewed it with two different browsers and cannot figure this one out. ...
0
7148
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
7367
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,...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5673
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,...
1
5072
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...
0
4743
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...
0
1581
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 ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
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...

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.