• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP timeout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中timeout函数的典型用法代码示例。如果您正苦于以下问题:PHP timeout函数的具体用法?PHP timeout怎么用?PHP timeout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了timeout函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: MM_reloadPage

<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>

</head>

<body  <?php 
if ($id_user != "") {
    $time = timeout($id_user);
    echo "onLoad=\"StartTimer({$time})\"";
}
?>
;MM_preloadImages('../images-index/entreprise_o_o.gif')" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="780" border="0" cellspacing="0" cellpadding="0" height="502">
  <tr>
    <td width="150" bgcolor="#FFcc66" height="551" valign="top">
      <?php 
include "../inc/connexion.php";
?>
      <?php 
include "../inc/navigue.php";
?>
      <?php 
include "../inc/rechercher.php";
开发者ID:SalokineTerata,项目名称:intranet,代码行数:31,代码来源:entreprise.php


示例2: dirname

}
include dirname(__FILE__) . '/config/config.php';
include dirname(__FILE__) . '/config/functions.php';
$language = array('en' => 'en', 'pt' => 'pt');
if (isset($_GET['lang']) and array_key_exists($_GET['lang'], $language)) {
    include dirname(__FILE__) . '/language/' . $language[$_GET['lang']] . '.php';
} else {
    include dirname(__FILE__) . '/language/en.php';
}
if (!$_SESSION['userLogin'] && !$_SESSION['userName'] && !isset($_SESSION['userName'])) {
    timeout();
} else {
    $time = time();
    if ($time > $_SESSION['expire']) {
        session_destroy();
        timeout();
        exit(0);
    }
}
$applicationid = strip_tags(trim($_SESSION['userName']));
$cetrollnumber = strip_tags(trim($_POST["cetrollnumber"]));
$cetmarks = strip_tags(trim($_POST["cetmarks"]));
$cetpercentile = strip_tags(trim($_POST["cetpercentile"]));
$finalapplicationid = htmlspecialchars($applicationid, ENT_QUOTES, 'UTF-8');
$finalcetrollnumber = htmlspecialchars($cetrollnumber, ENT_QUOTES, 'UTF-8');
$finalcetmarks = htmlspecialchars($cetmarks, ENT_QUOTES, 'UTF-8');
$finalcetpercentile = htmlspecialchars($cetpercentile, ENT_QUOTES, 'UTF-8');
if ($mysql == true) {
    $sqltestcet = "INSERT INTO `jbims_admission`.`users_cet_score_details` (`application_id`, `cet_roll_number`, `cet_marks`, `cet_percentile`) VALUES (\n\t\t\t'" . mysql_real_escape_string($finalapplicationid) . "',\n\t\t\t'" . mysql_real_escape_string($finalcetrollnumber) . "',\n\t\t\t'" . mysql_real_escape_string($finalcetmarks) . "',\n\t\t\t'" . mysql_real_escape_string($finalcetpercentile) . "'\n\t\t\t) \n\t\tON DUPLICATE KEY \n\t\tUPDATE \n\t\tcet_roll_number = VALUES(cet_roll_number),\n\t\tcet_marks = VALUES(cet_marks),\n\t\tcet_percentile = VALUES(cet_percentile)\n\t\t;";
    $inserttestcet = mysql_query($sqltestcet);
    if (!$inserttestcet) {
开发者ID:mydos,项目名称:JBIMS-Admission,代码行数:31,代码来源:processor-cet.php


示例3: timeout

<?php

function timeout($tm)
{
    echo time() . ": Timeout #{$tm}\n";
}
$timer1 = swoole_timer_tick(1000, 'timeout', 1);
$timer2 = swoole_timer_tick(2000, 'timeout', 2);
swoole_timer_tick(3000, function ($id) {
    timeout($id);
    //swoole_timer_clear($id);
    static $remove = true;
    if ($remove) {
        global $timer1;
        swoole_timer_clear($timer1);
        swoole_timer_tick(7000, 'timeout', 7);
        $remove = false;
    }
});
$timer4 = swoole_timer_tick(4000, 'timeout', 4);
$timer5 = swoole_timer_tick(5000, 'timeout', 5);
$timer6 = swoole_timer_tick(6000, 'timeout', 6);
开发者ID:noikiy,项目名称:swoole-src,代码行数:22,代码来源:tick.php


示例4: show_users

function show_users()
{
    global $setctl, $cfg, $valuser;
    kprintheader(get_lang(121));
    $slistu = $slistr = array();
    $result = db_execquery('SELECT u_id FROM ' . TBL_USERS . ' ORDER BY u_login ASC');
    while ($row = db_fetch_assoc($result)) {
        $uid = $row['u_id'];
        $res2 = db_execquery('SELECT login FROM ' . TBL_SESSION . ' WHERE u_id = ' . $uid . ' ORDER BY login DESC LIMIT 1');
        if (db_num_rows($res2) > 0) {
            $row = db_fetch_assoc($res2);
            $time = $row['login'];
        } else {
            $time = 0;
        }
        if ($time > 0) {
            $slistu[] = array($uid, $time);
        } else {
            $slistr[] = array($uid, 0);
        }
    }
    $ulist = array();
    while (true) {
        $ctime = 0;
        $lrow = 0;
        for ($i = 0, $c = count($slistu); $i < $c; $i++) {
            if ($slistu[$i][1] > $ctime) {
                $ctime = $slistu[$i][1];
                $lrow = $i;
            }
        }
        if ($ctime > 0) {
            $ulist[] = $slistu[$lrow];
            $slistu[$lrow][1] = -1;
        } else {
            break;
        }
    }
    for ($i = 0, $c = count($slistr); $i < $c; $i++) {
        $ulist[] = $slistr[$i];
    }
    $cnt = 0;
    ?>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="15%"></td>
		<td width="23%"></td>
		<td width="20%"></td>
		<td width="10%"></td>
		<td width="32%"></td>
	</tr>
	<?php 
    for ($uii = 0, $uic = count($ulist); $uii < $uic; $uii++) {
        $result = db_execquery('SELECT * FROM ' . TBL_USERS . ' WHERE u_id = ' . $ulist[$uii][0]);
        $row = db_fetch_assoc($result);
        $session = getlastlogin($row['u_id']);
        $ustatus = 0;
        if (!is_array($session)) {
            $uip = '';
            $usertime = '';
        } else {
            $uip = long2ip($session['ip']);
            if ($session['logout'] == 0 && !timeout($session['login'])) {
                $ustatus = 1;
            }
            $usertime = date($cfg['dateformat'], $session['login']);
        }
        if ($row['u_status'] == 2) {
            $ustatus = 2;
        }
        if ($cnt % 2 == 0) {
            echo '<tr class="row2nd">';
        } else {
            echo '<tr>';
        }
        $cnt++;
        $ulogin = $row['u_login'];
        $uname = '<font title="' . date($cfg['dateformat'], $row['created']) . '"';
        if ($row['utemplate'] == 1) {
            $template = true;
        } else {
            $template = false;
        }
        if ($template) {
            $uname .= ' color="blue">' . get_lang(321);
        } else {
            if ($row['u_access'] == 0) {
                $uname .= ' color="red">' . $row['u_name'];
            } else {
                $uname .= '>' . $row['u_name'];
            }
        }
        $uname .= '</font>';
        echo '<td class="file"><a class="hotnb" href="' . PHPSELF . '?action=useredit&amp;id=' . $row['u_id'] . '" title="' . get_lang(95) . '">' . $ulogin . '</a></td>';
        echo '<td class="file">' . $uname . '</td>';
        echo '<td class="file"><font title="' . $usertime . '"> ' . $uip . '</font></td>';
        switch ($ustatus) {
            case 0:
                $stout = get_lang(104);
                break;
//.........这里部分代码省略.........
开发者ID:skaligotla,项目名称:kplaylist,代码行数:101,代码来源:index.php


示例5: db_verify_stream

function db_verify_stream($cookie = '', $ip, $stream)
{
    global $u_id, $setctl, $cfg, $valuser;
    if ($cfg['disablelogin']) {
        $u_id = $cfg['assumeuserid'];
        loadvalidated($u_id);
        if ($valuser === false) {
            echo $cfg['assumeuserid'] . ' has a ID to a user that does not exist. Please set it correctly in the script and reload this page.';
            die;
        }
        return 1;
    } else {
        $ckexp = explode('-', $cookie);
        if (count($ckexp) == 2 && is_numeric($ckexp[0]) && is_numeric($ckexp[1])) {
            if ($stream) {
                $sql = 'SELECT u_id, login as u_time, sstatus FROM ' . TBL_SESSION . ' WHERE u_id = ' . $ckexp[0] . ' AND sessionid = ' . $ckexp[1];
            } else {
                $sql = 'SELECT u_id, login as u_time, sstatus FROM ' . TBL_SESSION . ' WHERE u_id = ' . $ckexp[0] . ' AND sessionid = ' . $ckexp[1] . ' AND logout = 0';
            }
            $result = db_execquery($sql);
            if ($result) {
                $row = db_fetch_assoc($result);
                $u_id = $row['u_id'];
                loadvalidated($u_id);
                $time = $row['u_time'];
                if ($valuser && !timeout($row['u_time'])) {
                    if ($row['sstatus'] == 2) {
                        $valuser->setro('u_access', 1);
                    }
                    return 1;
                }
            }
        }
        return 0;
    }
}
开发者ID:skaligotla,项目名称:kplaylist-ng,代码行数:36,代码来源:index.php


示例6: stop

 /**
  * Stop the server
  *
  * @return \Amp\Promise
  */
 public function stop() : Promise
 {
     switch ($this->state) {
         case self::STARTED:
             $stopPromise = resolve($this->doStop());
             return timeout($stopPromise, $this->options->shutdownTimeout);
         case self::STOPPED:
             return new Success();
         case self::STOPPING:
             return new Failure(new \LogicException("Cannot stop server: currently STOPPING"));
         case self::STARTING:
             return new Failure(new \LogicException("Cannot stop server: currently STARTING"));
         default:
             return new Success();
     }
 }
开发者ID:efueger,项目名称:aerys,代码行数:21,代码来源:Server.php


示例7: timeout

<?php

function timeout($tm)
{
    echo time() . ": Timeout #{$tm}\n";
    if ($tm == 5) {
        swoole_timer_after(3000, 'timeout', 7);
    }
}
$timer1 = swoole_timer_after(1000, function () {
    timeout(1);
    global $timer1, $timer3;
    swoole_timer_clear($timer1);
    swoole_timer_clear($timer3);
});
$timer2 = swoole_timer_after(2000, 'timeout', 2);
$timer3 = swoole_timer_after(4000, 'timeout', 3);
$timer4 = swoole_timer_after(8000, 'timeout', 4);
$timer5 = swoole_timer_after(10000, 'timeout', 5);
$timer6 = swoole_timer_after(5000, 'timeout', 6);
var_dump($timer1, $timer2, $timer3, $timer4, $timer5, $timer6);
swoole_process::signal(SIGTERM, function () {
    swoole_event_exit();
});
开发者ID:noikiy,项目名称:swoole-src,代码行数:24,代码来源:after.php


示例8: Popup

        <SCRIPT LANGUAGE='JavaScript'>
            function Popup(page, options) {
                document.location.href = '../index.php?action = delog';
            }
            function StartTimer(delai) {
                // Déclenche le timer à la fin du chargement de la page (delai est en secondes)
                setTimeout('Popup()', delai * 1000);
            }


        </SCRIPT>

    </head>

    <body onLoad='StartTimer(<?php 
$time = timeout($paramIdUser);
echo $time;
?>
)' bgcolor='#FFCC66' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
              <?php 
include 'cadrehautent.php';
?>
        <form name='salarie' method='post' action='gestion_salaries11.php'>
            <table width='620' border='0' cellspacing='0' cellpadding='0' height='178'>
                <tr>
                    <td>
                        <table border='0' cellspacing='0' cellpadding='0' width='600'>
                            <tr>
                                <td><img src='../images_pop/etape2_salaries.gif' height='62'></td>
                                <td><img src='../images_pop/gestion_salaries.gif' width='500' height='62'></td>
                                <td><a href='../aide.php#entreprise' target='_blank'><img src=../lib/images/bandeau_aide_point_interrogation.gif width='28' height='62' border='0'></a></td>
开发者ID:SalokineTerata,项目名称:intranet,代码行数:31,代码来源:gestion_salaries22.php


示例9: Popup

        <title>Gestion des salari&eacute;s</title>
        <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>

        <SCRIPT LANGUAGE='JavaScript'>
            function Popup(page, options) {
                document.location.href = '../index.php?action=delog';
            }
            function StartTimer(delai) {
                // Déclenche le timer à la fin du chargement de la page (delai est en secondes)
                setTimeout('Popup()', delai * 1000);
            }
        </SCRIPT>
    </head>

    <body onLoad='StartTimer(<?php 
$time = timeout($idUser);
echo $time;
?>
)' bgcolor='#FFCC66' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
              <?php 
include 'cadrehautent.php';
?>
        <form name='salarie' method='post' action='gestion_salaries2.php'>
            <table width='320' border='0' cellspacing='0' cellpadding='0'class='loginFFFFFFdroit' >
                <tr>
                    <td >
                        <table border='0' cellspacing='0' cellpadding='0' width='600'>
                            <tr>
                                <td><img src='../images_pop/etape1_salaries.gif'></td>
                                <td><img src='../images_pop/gestion_salaries.gif' width='500' height='62'></td>
                                <td><a href='../aide.php#entreprise' target='_blank'><img src=../lib/images/bandeau_aide_point_interrogation.gif width='28' height='62' border='0'></a></td>
开发者ID:SalokineTerata,项目名称:intranet,代码行数:31,代码来源:gestion_salaries1.php


示例10: timeout

<?php

function timeout($tm)
{
    echo time() . ": Timeout #{$tm}\n";
}
$timer1 = swoole_timer_tick(1000, 'timeout', 1);
$timer2 = swoole_timer_tick(2000, 'timeout', 2);
swoole_timer_tick(3000, function ($id) {
    timeout(3);
    swoole_timer_clear($id);
    global $timer1;
    swoole_timer_clear($timer1);
    swoole_timer_tick(7000, 'timeout', 7);
});
$timer4 = swoole_timer_tick(4000, 'timeout', 4);
$timer5 = swoole_timer_tick(5000, 'timeout', 5);
$timer6 = swoole_timer_tick(6000, 'timeout', 6);
开发者ID:zzjin,项目名称:swoole-src,代码行数:18,代码来源:tick.php


示例11: Popup

        </script>
        <SCRIPT LANGUAGE='JavaScript'>
            function Popup(page, options) {
                document.location.href = '../index.php?action = delog';
            }
            function StartTimer(delai) {
                // Déclenche le timer à la fin du chargement de la page (delai est en secondes)
                setTimeout('Popup()', delai * 1000);
            }
        </SCRIPT>
        <link rel='stylesheet' href='../lib/css/admin_intra01.css' type='text/css'>
        <link rel='stylesheet' href=../lib/css/admin_newspopup.css type='text/css'>
    </head>

    <body onLoad='StartTimer(<?php 
$time = timeout($login);
echo '$time';
?>
)' bgcolor='#FFCC66' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
              <?php 
include 'cadrehautent.php';
?>
        <form name='salarie' method='post' action='gestion_salaries1.php'>
            <input type=hidden name=sal_user value=<?php 
$idUser;
?>
>


            <table width='620' border='0' cellspacing='0' cellpadding='0' height='178'>
                <tr>
开发者ID:SalokineTerata,项目名称:intranet,代码行数:31,代码来源:gestion_salaries2.php



注:本文中的timeout函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP timer函数代码示例发布时间:2022-05-23
下一篇:
PHP timeformat函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap