# PHP/MySQL/Flash login system problem

**URL:** <https://forum.kirupa.com/t/php-mysql-flash-login-system-problem/151085>\
**Category:** flash\
**Created:** [June 13, 2005, 7:07am UTC](https://forum.kirupa.com/t/php-mysql-flash-login-system-problem/151085 "2005-06-13T07:07:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepglue](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@deepglue](https://forum.kirupa.com/u/deepglue)\
**Post date:** [June 13, 2005, 7:07am UTC](https://forum.kirupa.com/t/php-mysql-flash-login-system-problem/151085/1 "2005-06-13T07:07:56Z")

</div>

I have a working login system in Flash. Here’s the code in login.php:  
\*\*  
\<?php

if (isset($\_POST[‘username’]) && isset($\_POST[‘pwd’])) {

```
require_once('database.php');

if (!get_magic_quotes_gpc()) {
foreach($_POST as $key=&gt;$value) {
$temp = addslashes($value);
$_POST[$key] = $temp;
}

```

}

include(’…/connect.inc’);

$sql = ‘SELECT \* FROM users WHERE username = "’.$\_POST[‘username’].’" AND password = “’.$\_POST[‘pwd’].’”’;  
$result = $db-\>query($sql);

if ($result-\>num\_rows \> 0) {  
echo ‘authenticated=ok’;  
}  
else {  
echo ‘authenticated=getLost’;  
}

```
$db-&gt;close();

```

}  
?\>\*\*

This works fine but what would I need to add to be able to greet the user by their first name once they’re logged in? In the database I have several rows like username, password, email, firstname, lastname…

Any help would be appreciated!
