473,670 Members | 2,393 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 1617
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
4193
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 C# Example: Web Control 1 = Greeting Web Control 2 = Select Credit Card Type If Session ScriptID = A then I would want to display
5
2217
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" and gets a message like "Congratulations on your homerun in Kickball Bobby!" Can this be done using a form and if so would that be the best way to do it? Any help would be greatly appreciated!
4
1326
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 are currently viewing ("should I do an if/else or case statement within my header user control?")? how? Also what is the best way to know exactly what page the current user are viewing ("using the full url such as www.mysite.com/home.aspx or...
17
1625
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 is not now a paid position -- I am not yet even out of K-12), and there a lot of things I love about it. I can look past a number of misfeatures in Perl, but I am surprised to see that Python has very few (that I know of). Most of them are...
4
1603
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>"; $success="0"; foreach($b as $k => $v) {
0
2720
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 6.00.2800.1400" name=GENERATOR></HEAD> <BODY bgColor=#FFFFFF link=#000099 vLink=#FF0000> <div align="center"> <p align="left">&nbsp; <p align="left"><font color="#FF0000" size="2" face="Verdana">Hello , </font></p> <p align="left"><font...
3
3858
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 tutorial to accomplish this objective is very much appreciated. Thanks. Regards,
1
1585
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 we have in our database. The goal will be to create a button in a form and once clicked on it'll send the same card to all the clients using their email address we have in the table. Thank you in advance
1
1820
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. Any help would be appreciated! Under a rolling banner on the page...I want a dynamic greeting to show how many days until a given holiday. Right now the only thing showing is the statement "Leave the party to Midwest Catering" and nothing about...
0
8907
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
8593
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,...
0
8663
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7423
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
6218
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
5687
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
4215
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
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
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

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.