Every time I try to login to my page it takes me to the invalid login page. I have tried valid usernames and passwords and they still don't work. I have echoed the login variables and I know they are getting to the validation page. I also echoed the first result variable and get a Result ID #2. Not sure what that means. Here is the query string and what I am trying to do with it:
<?php
session_start();
$password=$POST["username"];
$username=$POST["password"];
echo "$password";
echo "$username";
$db = mysql_connect("servername", "serversignon", "serverpwd");
mysql_select_db("dbname", $db);
$result = mysql_query("SELECT * FROM paypal");
if ($myrow = mysql_fetch_array($result)) {
$hash = mysql_result($result,0,"password");
$salt = substr($hash, 0, 2);
$password = crypt($password,$salt);
$result2 = mysql_query("SELECT * FROM paypal WHERE username = $username AND password = $password");
if (!empty($result2)) {
if ($myrow2 = mysql_fetch_array($result2)) {
$active = $myrow2["active"];
$wore = $myrow2["first_name"];
$location = getenv("REQUEST_URI");
$host = getenv("REMOTE_HOST");
$today = (date("Y-m-d H:i:s"));
$first_name = $myrow2["first_name"];
$last_name = $myrow2["last_name"];
$payer_email = $myrow2["payer_email"];
$item_name = $myrow2["item_name"];
$name = "$first_name $last_name";
Any help would be great. Thanks