Accessing Function Parameters
<?php
function validatelogin ($username, $password){
$actualuser = "myusername";
$actualpass = "mypassword";
if (strcmp ($username, $actualuser) == 0 && strcmp ($password, $actualpass) == 0){
return true;
} else {
return false;
}
}
if (validatelogin ("myusername","mypassword")){
echo "You are logged in correctly";
} else {
echo "You have an incorrect username and/or password";
}
?>
Related examples in the same category