php preg-match is returning only false
Posted: Wed Apr 15, 2015 9:37 am
Hello. I started to make a login system for my website. Everything was going a bit ok. I got some good tutorials on internet (I'm still beginner on php). Until now, I did this script, also register script but that script has some syntax problems but I'll make it works.
Now I have a problem with login script.
I have a code:
This should return true if the user and pass are ok.
Now I have this code:
Ok, so Even if I put a user and password like Test123, I got this error: Errors
Invalid Form Data
For live preview: http://astral-gaming.com/login.php
Can someone help me to make this login work? I just have no ideea why I get this error.
Now I have a problem with login script.
I have a code:
Code: Select all
return (preg_match('/^[a-zA-Z0-9](5,12)$/',$this->_username) && preg_match('/^[a-zA-Z0-9](5,12)$/',$this->_password)) ? 1 : 0;
Now I have this code:
Code: Select all
if(!$this->isDataValid())
throw new Exception('Invalid Form Data');Invalid Form Data
For live preview: http://astral-gaming.com/login.php
Can someone help me to make this login work? I just have no ideea why I get this error.