# Is the PHP wrong?

**URL:** https://forum.kirupa.com/t/is-the-php-wrong/160638
**Category:** Uncategorized
**Created:** [August 27, 2005, 11:46pm UTC](https://forum.kirupa.com/t/is-the-php-wrong/160638 "2005-08-27T23:46:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pbrollwitme](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@pbrollwitme](https://forum.kirupa.com/u/pbrollwitme)
#### Post date: [August 27, 2005, 11:46pm UTC](https://forum.kirupa.com/t/is-the-php-wrong/160638/1 "2005-08-27T23:46:54Z")

</div>

Ok, no offense to the kirupian who wrote the authentication tutorial, i’m probably missing something small and stupid but is the php right?? i’m using:

```php

<?
$user=$_POST['user'];
$pass=$_POST['pass'];
//connect to database
if ($user && $pass){
 mysql_pconnect("localhost","myuser","mypassword") or die ("didn't connect to mysql");
 mysql_select_db("mydatabase") or die ("no database");
//make query
$query = "SELECT * FROM users WHERE username = '$user' AND password = '$pass'";
$result = mysql_query( $query ) or die ("didn't query");
//see if there's an EXACT match
$num = mysql_num_rows( $result );
if ($num == 1){
 print "status=You're in&checklog=1";
 } else {
 print "status=Sorry, but your user name and password did not match a user name/password combination in our database. Usernames and passwords are entered in from a different file. Thank you for visiting test login script!!&checklog=2";
}
}
?>

```

now the problem is that the checklog function will not work in my flash app. , yet the “you’re in” shows up in the status textbox. Is that the proper way to set a variable that flash can read? I know “&” is neccessary, but should it be spaced from You’re in or should it be a function or am I going crazy:puzzle: Or…is the php right and somethings wrong with the swf file?

sorry if this is a double post, i just figured the server-side area might get people who know php a little better.

Thanks in advance!
