# Php member login Please help

**URL:** <https://forum.kirupa.com/t/php-member-login-please-help/250049>\
**Category:** Uncategorized\
**Created:** [January 24, 2008, 10:11pm UTC](https://forum.kirupa.com/t/php-member-login-please-help/250049 "2008-01-24T22:11:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josephnwachukwu](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@josephnwachukwu](https://forum.kirupa.com/u/josephnwachukwu)\
**Post date:** [January 24, 2008, 10:11pm UTC](https://forum.kirupa.com/t/php-member-login-please-help/250049/1 "2008-01-24T22:11:45Z")

</div>

Hi Im trying to make a members login for my site but im having trouble getting any signal that the user has got in success fully. Here is my actionscript and php. My host is netfirms.

```auto

login.loginButton.onRelease = function() {
    if (login.userName.length>0 && login.userPassword.length>0) {
        myVars = new LoadVars();
        myVars.username = escape(login.userName.text);
        myVars.pass = escape(login.userPassword.text);
        myVars.action = "login";
        myVars.sendAndLoad("http://www.hiptopdesign.com/login.php", myVars, 'POST');
        myVars.onLoad = function() {
            if (!this.error && this.user>0) {
                //_root.gotoAndStop('registered');
                login.userName.text = "logged in";
                _root.login.lstat.text = myVars;
                trace(myVars);
            } else {
                //_root.gotoAndStop('no_registered');
                login.userName.text = "not logged in";
                _root.login.lstat.text = myVars;
                trace(myVars);
            }
            userName.selectable = true;
            userPassword.selectable = true;
            loginButton.enabled = true;
        };
        //userName.selectable = false;
        //userPassword.selectable = false;
        //loginButton.enabled = false;
    }
};

```

here is the php

```php

<?php
require_once('db.php');
include('functions.php');
    if(isset($_GET['Login']))
    {
        if($_GET['username']!='' && $_GET['pass']!='')
        {
            //Use the input username and password and check against 'users' table
            $query = mysql_query('SELECT ID, Username, Active FROM users WHERE Username = "'.mysql_real_escape_string($_GET['username']).'" AND Password = "'.mysql_real_escape_string(md5($_GET['pass'])).'"');
            
            if(mysql_num_rows($query) == 1)
            {
                $row = mysql_fetch_assoc($query);
                if($row['Active'] == 1)
                {
                    session_start();
                    $_SESSION['user_id'] = $row['ID'];
                    $_SESSION['logged_in'] = TRUE;
                                        echo $_POST['username'];
                                        print $_POST['username'];
                    header("Location: members.php");
                }
                else {
                    $error = 'Your membership was not activated. Please open the email that we sent and click on the activation link';
                }
            }
            else {        
                $error = 'Login failed !';        
            }
        }
        else {
            $error = 'Please user both your username and password to access your account';
        }
    }
?>

<?php if(isset($error)){ echo $error;}?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
    <input type="text" id="username" name="username" size="32" value="" />
    <input type="password" id="pass" name="pass" size="32" value="" />
    <input type="submit" name="Login" value="Login" />
</form>

```

please any thoughts would be appreciated
