subter Posted August 11, 2008 Share Posted August 11, 2008 I began looking into PHP a few days ago and became really interested in it. I searched for a registration / login script tutorial, and found quiet a few. Here is a link to the tutorial I'm using at the moment: http://blog.nightgen.com/?p=67 The part of the tutorial that I'm getting stuck at is: $_POST['email'] = trim($_POST['email']); if($_POST['email']){ if(!eregi(”^[a-zA-Z0-9]+[a-zA-Z0-9_.-]*@[a-zA-Z0-9]+[a-zA-Z0-9_.-])*\.[a-z]{2,4}$”, $_POST['email'])){ $error['emailerror'] = ‘Email Incorrect’; } } else { $error['emailinput'] = ‘Please supply an email address’; } To be more specific, it's the eregi function. I've searched up and down for a good explanation as to what this function is used for and how to properly use it, but I haven't yet found one that has been much help, hence the reason I'm posting here. If anyone can shed a little light my way, I would greatly appreciate it! If you have another suggestion for a registration / login script tutorial, that would be great too. Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/119197-solved-registrationlogin-script-help/ Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 eregi() is the case-insensitive version of ereg(), which is used to test regular expressions. ereg() uses the POSIX flavor of regex, where as preg_match() uses PCRE. Google "regular expression" and you'll get some hits. Also, if you ever see an unknown function, check the PHP manual first. Just type the function name at the end of php.net: http://www.php.net/eregi Link to comment https://forums.phpfreaks.com/topic/119197-solved-registrationlogin-script-help/#findComment-613887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.