Jump to content
php.lv forumi

Deprecated: Function eregi() is deprecated


jackass1919

Recommended Posts

Sveiki.

 

Varbūt kāds var izpalīdzēt?

 

Errors:

 

Deprecated: Function eregi() is deprecated in E:\wamp\www\site\userinfo.php on line 22

 

Izmantoju wamp serveri jaunāko versiju.

 

Šeit ir tās rindiņas

 

/* Requested Username error checking */
$req_user = trim($_GET['user']);
if(!$req_user || strlen($req_user) == 0 ||
  !eregi("^([0-9a-z])+$", $req_user) ||
  !$database->usernameTaken($req_user)){
  die("Username not registered");
}

 

mazliet pameklēju un atradu to pašu problēmu šeit

http://forums.oscommerce.com/topic/341025-function-eregi-is-deprecated/

Bet tur tas gadījums atšķiras, bet ir līdzīgs, ja kāds mācētu pārlabot to kodu, cik sapratu uz PHP 5 tas vairs nedarbojas...

 

Žēl ka esmu noobs ar sintakses problēmām :D

Link to comment
Share on other sites

/* Requested Username error checking */
$req_user = trim($_GET['user']);
if(!$req_user || strlen($req_user) == 0 ||
!preg_match("^([0-9a-z])+$", $req_user) ||
!$database->usernameTaken($req_user)){
die("Username not registered");
}

vajadzetu iet

Edited by bobsters
Link to comment
Share on other sites

/* Requested Username error checking */
$req_user = trim($_GET['user']);
if(!$req_user || strlen($req_user) == 0 ||
!preg_match("/^[0-9a-z]/+$", $req_user) ||
!$database->usernameTaken($req_user)){
die("Username not registered");
}

 

 

 

pasties pats preg_match() funkciju

Edited by bobsters
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...