hi there,
this is my first post here so please be kind 🙂
I'm building a Flash login movie. I've got the usernames + passwords stored in a mysql database. Each user (in the table) has 2 extra variables; rlink and email.
I need a Php script that returns wether the username exists, checks the password according to the username, returns the string "valid or invalid", returns the string "rlink" according to the username and returns the string "email" according to the username.
the strings "rlink" and "email" are ofcourse in the mysql database.
here's something i've worked on myself (thanks to all those tutorials on the internet) and it works great for returning the string "valid or invalid", but now im stuck
i need the string "rlink" and the string "email".
here's the code i worked on myself:
<?php
$dbconn = mysql_connect("localhost", "test", "test" );
mysql_select_db('test', $dbconn);
$query = "SELECT * FROM users
WHERE name='$name' AND password='$password'";
$result = mysql_query($query, $dbconn) or die('error making query');
$affected_rows = mysql_num_rows($result);
if($affected_rows == 1) {
print 'login=valid';
print '&rlink=$password';
print '&email=email';
}
else {
print 'login=invalid';
}
?>
this just returns exactly what is between the """"" but i need the variables in my database.
hope this makes sense.
thanks.