be sure, that you close your functions:
a function should looks like:
function function_name()
{
} <<--- you need to close it with a bracket.
Your form should be closed:
<input type='reset' name='reset' value='Reset Form'></form>
These lines have no sense:
strlen(trim($uName));
strlen(trim($pass));
If you want to check if these strings shorter then 2 characters, do like this:
if(strlen(trim($uName))<3 OR strlen(trim($pass))<3)
return true;
If somebody suggested that its easier to solve with flat files then you should not listen to him/her.
If you're using files to store passwords and usernames, on evry user check you need to open a file, list its lines and explode it.
$data=file("users.txt");
you need to walk along its lines, and explode them using a separator character ; or |. On registration lets filter the user inputs , do not allow ; character as user name or password.
<?php
function user_exists( $username )
{
$data = file( "users.txt" );
foreach( $data AS $lines ) {
$details = explode( ";" , $lines );
// lets check if a user exists:
if ( trim($username) == trim($details[0]) )
return true;
}
return false;
}
?>
Maybe this little example gives you ideas how to solve this program.