I got this tutorial from Kirupa, but obtain the following error, how do I correct it.
Error opening URL “file:///C|/Documents%20and%20Settings/OK1/Desktop/authentication/localhost/newlogin.php”
In first frame :
stop();
userinput.restrict=“a-zA-Z0-9”;
Selection.setFocus(userinput);
passinput.restrict=“a-zA-Z0-9”;
status=“Enter your information and submit”;
this.onEnterFrame = function () {
if(_root.checklog == 1){
_root.gotoAndStop(2);
}
if(_root.checklog == 2){
_root.gotoAndStop(3);
}
}
Attach to button:
on (release, keyPress “<Enter>”) {
if (user != “” && pass != “”) {
status = "Begin Login Process - Wait...";
loadVariablesNum("localhost/newlogin.php", 0, "POST");
}
}
Php code:
<?
//this pulls the variables from the flash movie when the user
//hits submit. Use this when your global variables are off.
//I don’t know how to toggle global variables, so I just put
//it in all the time
$user=$_POST[‘user’];
$pass=$_POST[‘pass’];
//connect to database
if ($user && $pass){
mysql_pconnect(“mysqld@localhost”,“root”,“yes”) or die (“didn’t connect to mysql”);
mysql_select_db(“dvd_collection”) or die (“no database”);
//make query
$query = “SELECT * FROM auth WHERE username = ‘$user’ AND userpassword = ‘$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”;
}
}
?>
Database:
CREATE TABLE auth (
userid
int(4)
unsigned
zerofill
DEFAULT ‘0000’
NOT NULL
auto_increment,
username varchar(20),
userpassword varchar(20),
PRIMARY KEY (userid)
);