# Log In Script Problem

**URL:** <https://forum.kirupa.com/t/log-in-script-problem/240279>\
**Category:** programming\
**Created:** [October 1, 2007, 4:05pm UTC](https://forum.kirupa.com/t/log-in-script-problem/240279 "2007-10-01T16:05:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsmflash](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@dsmflash](https://forum.kirupa.com/u/dsmflash)\
**Post date:** [October 1, 2007, 4:05pm UTC](https://forum.kirupa.com/t/log-in-script-problem/240279/1 "2007-10-01T16:05:28Z")

</div>

I used the kirupa tutorial on creating a flash login form and have a few questions:  
1.) when user fills in username and password, how do i direct them to the appropriate page?  
2.) i want each user to be directed to a certain page, how do i specify what username and password goes with what page.

\<?  
$user=$\_POST[‘user’];  
$pass=$\_POST[‘pass’];

if ($user && $pass){  
mysql\_pconnect(“[mysql.yourhost.com](http://mysql.yourhost.com)”,“yourusername”,“yourpassword”) or die (“didn’t connect to mysql”);  
mysql\_select\_db(“yourdatabase”) or die (“no database”);

$query = “SELECT \* FROM yourtable WHERE username = ‘$user’ AND userpassword = ‘$pass’”;  
$result = mysql\_query( $query ) or die (“didn’t query”);

$num = mysql\_num\_rows( $result );  
if ($num == 1){  
print “status=You’re in&checklog=1”;  
} else {  
print “status=Sorry, but your username/password is not correct.  
Please contact Stoneworks.&checklog=2”;  
}  
}  
?\>

I am designing a site for a business who wants to allow customers to login access a page where they can check the progress of their project. the kirupa tutorial is perfect because the client can go in and designate usernames and passwords.

Thanks For all replies.
