Доброе время суток народ, нужна ваша помощь, а именно замена ereg на preg_match, я пытался заменить сам, но я еще в php чайник , и у меня ничего не получается.вот ошибка:
Deprecated: Function ereg() is deprecated in /home/u763146566/public_html/request.php on line 113 Deprecated: Function ereg() is deprecated in /home/u763146566/public_html/request.php on line 132 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 147 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 148 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 150 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 153 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 154 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 155 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 164 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 165 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 166 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 168 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 169 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 170 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/function/function.php on line 113 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/function/function.php on line 113 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 199 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 68
а тут часть кода:
if (!isset($err)) {
if (!ereg("/",$_REQUEST["url"])) { $_REQUEST["url"]=$_REQUEST["url"]."/"; }
$temp_url = explode("/", $_REQUEST["url"]);
$correct_url="";
$c_u=count($temp_url);
for ($i=0; $i<$c_u; $i++) {
if ($c_u!=($i+1)) {
$correct_url.=$temp_url[$i]."/";
}
}
$_REQUEST["url"]=strtolower($correct_url);
$check = count_table("`".table_prefix."links_base` WHERE `url`='".addslashes(str_replace(',', '.', $_REQUEST["url"]))."' OR `url`='".addslashes(str_replace('www.', '', str_replace(',', '.', $_REQUEST["url"])))."' OR `url`='www.".addslashes(str_replace(',', '.', $_REQUEST["url"]))."' LIMIT 1"
;
if ($_REQUEST["id"]==0) { if ($check>0) { $err[]=$str_text_content[10]; } } // Ваш сайт уже присутствует в каталоге
}
if (!isset($err)) {
if (!ereg("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$_REQUEST["email"])) { $err[]=$str_text_content[11]; } // Введите правильный email!
$_REQUEST["title"]=str_replace(",", ", ", $_REQUEST["title"]);
//$_REQUEST["title"]=str_replace(".", ". ", $_REQUEST["title"]);
$_REQUEST["title"]=str_replace(":", ": ", $_REQUEST["title"]);
$_REQUEST["title"]=str_replace(";", "; ", $_REQUEST["title"]);
$_REQUEST["description"]=str_replace(",", ", ", $_REQUEST["description"]);
//$_REQUEST["description"]=str_replace(".", ". ", $_REQUEST["description"]);
$_REQUEST["description"]=str_replace(":", ": ", $_REQUEST["description"]);
$_REQUEST["description"]=str_replace(";", "; ", $_REQUEST["description"]);
$_REQUEST["title"]=str_replace("", " ", $_REQUEST["title"]);
$_REQUEST["description"]=str_replace("", " ", $_REQUEST["description"]);
$_REQUEST["keywords"]=str_replace("", " ", $_REQUEST["keywords"]);
$_REQUEST["title"]=ereg_replace(" +"," ",wordwrap($_REQUEST["title"],25,' ',1));
$_REQUEST["description"]=ereg_replace(" +"," ",wordwrap($_REQUEST["description"],25,' ',1));
$_REQUEST["keywords"]=preg_replace('{[-.,!?:
("]}is', ' ',$_REQUEST["keywords"]);
$_REQUEST["keywords"]=strtolower(ereg_replace(" +"," ",wordwrap($_REQUEST["keywords"],25,' ',1)));
if (!eregi("\.",$_REQUEST["url"])) { $err[]=$str_text_content[29]; } // Некорректный адрес сайта
if (eregi("ftp:",$_REQUEST["url"])) { $err[]=$str_text_content[12]; } // Принимаються только сайты!
if (eregi("https:",$_REQUEST["url"])) { $err[]=$str_text_content[13]; } // Принимаються только сайты!
if (strlen($_REQUEST["title"])>201) { $err[]=$str_text_content[14]; } // Пункт 'Название' содержит более 200 символов.
if (strlen($_REQUEST["title"])<10) { $err[]=$str_text_content[15]; } // Пункт 'Название' содержит менее 10 символов.
if (strlen($_REQUEST["url"])>50) { $err[]=$str_text_content[16]; } // Пункт 'Ссылка' содержит более 50 символов.
if (strlen($_REQUEST["description"])<50) { $err[]=$str_text_content[17]; } // Пункт 'Описание' содержит менее 50 символов.
if (strlen($_REQUEST["description"])>1501) { $err[]=$str_text_content[18]; } // Пункт 'Описание' содержит более 1500 символов.
if (eregi(preg_quote("<a"
,$_REQUEST["title"])) { $err[]=$str_text_content[19]; } // Нельзя публиковать ссылку в поле 'Название'.
if (eregi(preg_quote("[url"
,$_REQUEST["title"])) { $err[]=$str_text_content[20]; } // Нельзя публиковать ссылку в поле 'Название'.
if (eregi(preg_quote(""
,$_REQUEST["title"])) { $err[]=$str_text_content[21]; } // Нельзя публиковать ссылку в поле 'Название'.
if (eregi(preg_quote("<a"
,$_REQUEST["description"])) { $err[]=$str_text_content[22]; } // Нельзя публиковать ссылку в поле 'Описание'.
if (eregi(preg_quote("[url]" ),$_REQUEST["description"])) { $err[]=$str_text_content[23]; } // Нельзя публиковать ссылку в поле 'Описание'.
if (eregi(preg_quote(""http: //" ),$_REQUEST["description"])) { $err[]=$str_text_content[24]; } // Нельзя публиковать ссылку в поле 'Описание'.
Прошу помогите пожалуйста, заранее спасибо.
Deprecated: Function ereg() is deprecated in /home/u763146566/public_html/request.php on line 113 Deprecated: Function ereg() is deprecated in /home/u763146566/public_html/request.php on line 132 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 147 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 148 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 150 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 153 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 154 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 155 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 164 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 165 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 166 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 168 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 169 Deprecated: Function eregi() is deprecated in /home/u763146566/public_html/request.php on line 170 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/function/function.php on line 113 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/function/function.php on line 113 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 199 Deprecated: Function ereg_replace() is deprecated in /home/u763146566/public_html/request.php on line 68
а тут часть кода:
if (!isset($err)) {
if (!ereg("/",$_REQUEST["url"])) { $_REQUEST["url"]=$_REQUEST["url"]."/"; }
$temp_url = explode("/", $_REQUEST["url"]);
$correct_url="";
$c_u=count($temp_url);
for ($i=0; $i<$c_u; $i++) {
if ($c_u!=($i+1)) {
$correct_url.=$temp_url[$i]."/";
}
}
$_REQUEST["url"]=strtolower($correct_url);
$check = count_table("`".table_prefix."links_base` WHERE `url`='".addslashes(str_replace(',', '.', $_REQUEST["url"]))."' OR `url`='".addslashes(str_replace('www.', '', str_replace(',', '.', $_REQUEST["url"])))."' OR `url`='www.".addslashes(str_replace(',', '.', $_REQUEST["url"]))."' LIMIT 1"

if ($_REQUEST["id"]==0) { if ($check>0) { $err[]=$str_text_content[10]; } } // Ваш сайт уже присутствует в каталоге
}
if (!isset($err)) {
if (!ereg("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$_REQUEST["email"])) { $err[]=$str_text_content[11]; } // Введите правильный email!
$_REQUEST["title"]=str_replace(",", ", ", $_REQUEST["title"]);
//$_REQUEST["title"]=str_replace(".", ". ", $_REQUEST["title"]);
$_REQUEST["title"]=str_replace(":", ": ", $_REQUEST["title"]);
$_REQUEST["title"]=str_replace(";", "; ", $_REQUEST["title"]);
$_REQUEST["description"]=str_replace(",", ", ", $_REQUEST["description"]);
//$_REQUEST["description"]=str_replace(".", ". ", $_REQUEST["description"]);
$_REQUEST["description"]=str_replace(":", ": ", $_REQUEST["description"]);
$_REQUEST["description"]=str_replace(";", "; ", $_REQUEST["description"]);
$_REQUEST["title"]=str_replace("", " ", $_REQUEST["title"]);
$_REQUEST["description"]=str_replace("", " ", $_REQUEST["description"]);
$_REQUEST["keywords"]=str_replace("", " ", $_REQUEST["keywords"]);
$_REQUEST["title"]=ereg_replace(" +"," ",wordwrap($_REQUEST["title"],25,' ',1));
$_REQUEST["description"]=ereg_replace(" +"," ",wordwrap($_REQUEST["description"],25,' ',1));
$_REQUEST["keywords"]=preg_replace('{[-.,!?:

$_REQUEST["keywords"]=strtolower(ereg_replace(" +"," ",wordwrap($_REQUEST["keywords"],25,' ',1)));
if (!eregi("\.",$_REQUEST["url"])) { $err[]=$str_text_content[29]; } // Некорректный адрес сайта
if (eregi("ftp:",$_REQUEST["url"])) { $err[]=$str_text_content[12]; } // Принимаються только сайты!
if (eregi("https:",$_REQUEST["url"])) { $err[]=$str_text_content[13]; } // Принимаються только сайты!
if (strlen($_REQUEST["title"])>201) { $err[]=$str_text_content[14]; } // Пункт 'Название' содержит более 200 символов.
if (strlen($_REQUEST["title"])<10) { $err[]=$str_text_content[15]; } // Пункт 'Название' содержит менее 10 символов.
if (strlen($_REQUEST["url"])>50) { $err[]=$str_text_content[16]; } // Пункт 'Ссылка' содержит более 50 символов.
if (strlen($_REQUEST["description"])<50) { $err[]=$str_text_content[17]; } // Пункт 'Описание' содержит менее 50 символов.
if (strlen($_REQUEST["description"])>1501) { $err[]=$str_text_content[18]; } // Пункт 'Описание' содержит более 1500 символов.
if (eregi(preg_quote("<a"

if (eregi(preg_quote("[url"

if (eregi(preg_quote(""

if (eregi(preg_quote("<a"

if (eregi(preg_quote("[url]" ),$_REQUEST["description"])) { $err[]=$str_text_content[23]; } // Нельзя публиковать ссылку в поле 'Описание'.
if (eregi(preg_quote(""http: //" ),$_REQUEST["description"])) { $err[]=$str_text_content[24]; } // Нельзя публиковать ссылку в поле 'Описание'.
Прошу помогите пожалуйста, заранее спасибо.
Изменено:
Vitaliy Ivanov - 28 Марта 2014 03:02
(Смайлыыы)