I was working on a login form and the session of it. Now I'm getting this error:
Parse error: syntax error, unexpected 'strlen' (T_STRING) in /home/xxx/domains/xxx/public_html/server/include/session.php on line 130
This is the line of the error:
if(!$subuser strlen($subuser = trim($subuser)) == 0){
This is the whole code:
function login($subuser, $subpass, $subremember){
global $database, $form; //The database and form object
/* Username error checking */
$field = "user"; //Use field name for username
if(!$subuser strlen($subuser = trim($subuser)) == 0){
$form->setError($field, "* Username not entered");
}
else{
/* Check if username is not alphanumeric */
if(!eregi("^([0-9a-z])*$", $subuser)){
$form->setError($field, "* Username not alphanumeric");
}
}
(!$subuser strlen($subuser = trim($subuser)) == 0)
. It can probably also be written as(strlen(trim($subuser)) == 0)
– Magnus Eriksson Oct 6 '18 at 22:00eregi()
. – Funk Forty Niner Oct 6 '18 at 22:01