PrinceOfDragons Posted August 10, 2009 Share Posted August 10, 2009 I have a function I came up with to use to check a username input from the forum field, Im just wondering if someone can check it and tell me if there is a better way of doing it. Thank You!!! function checkUname() { global $uname; if($this->username == "") { echo "Username field is blank"; $this->myErrors++; } elseif($uname != $_POST['username'] && $_POST['Log-In'] == "Log-In"){ echo "Username does not exist"; $this->myErrors++; } elseif(strlen($this->username) < "5") { echo "Username is to short"; $this->myErrors++; } elseif(!eregi("^([0-9a-z])*$", $this->username)) { echo "Username is not Alphanumeric"; $this->myErrors++; } elseif($uname == true && $_SESSION['create'] == "Create Account"){ echo "Username Taken"; $this->myErrors++; Link to comment https://forums.phpfreaks.com/topic/169586-check-username-forum-field/ Share on other sites More sharing options...
PrinceOfDragons Posted August 10, 2009 Author Share Posted August 10, 2009 No help ? :'( Link to comment https://forums.phpfreaks.com/topic/169586-check-username-forum-field/#findComment-895067 Share on other sites More sharing options...
Russia Posted August 10, 2009 Share Posted August 10, 2009 This forum is I think dead. No one reply's to my topics either... Link to comment https://forums.phpfreaks.com/topic/169586-check-username-forum-field/#findComment-895089 Share on other sites More sharing options...
PrinceOfDragons Posted August 11, 2009 Author Share Posted August 11, 2009 I see plenty of other topics being replied to why not mine :'(. Link to comment https://forums.phpfreaks.com/topic/169586-check-username-forum-field/#findComment-895249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.