phpͳ¼ÆIPÒÔ¼°ÔÚÏßÈËÊýµÄͳ¼Æ
1.ÓÃJSµ÷ÓÃÎļþcount.php ÔÚÄãÐèÒª¼ÓÈëͳ¼ÆµÄµÄµØ·½¼ÓÈë<script src="count.php"></script> ʵ¼ÊÔËÓÃÖÐ×¢ÒâÐ޸ķ¾¶£¡
2.php»·¾³±ØÐëÖ§³Öputenv()º¯Êý,¿ÉÒÔͳ¼Æ×òÈÕ·ÃÎÊ£¬½ñÈÕ·ÃÎÊ£¬ÔÚÏßÈËÊý,Äú·ÃÎʵĴÎÊý¡£
3 . ÔÚcount.phpÏàͬĿ¼½¨Á¢ÒÔÏÂÎļþ count,temp,online,н¨Îı¾Îĵµcount.txt È»ºóÈ¥µôÀ©Õ¹Ãû¾ÍÊÇÎļþcountÁË£»Èç¹ûÊÇLinuxÖ÷»úÇë°ÑÕâÈý¸öÎļþÊôÐÔÉèΪ777.
count.phpÎļþ´úÂë:
<?
$file = "count"; // ¼ÇÊýÎļþÃû³Æ
$startno = "1000"; // ÆðʼÊýÖµ
$tempfile = "temp";
$t_now = time();
$t_array = getdate($t_now);
$day = $t_array['mday'];
$mon = $t_array['mon'];
$year = $t_array['year'];
if (file_exists("$file")) {
$count_info=file("$file");
$c_info = explode(",", $count_info[0]);
$total_c=$c_info[0];
$yesterday_c=$c_info[1];
$today_c=$c_info[2];
$lastday=$c_info[3];
} else {
$total_c="$startno";
$yesterday_c="0";
$today_c="0";
$lastday="0";
}
if ( !isset($HTTP_COOKIE_VARS["countcookie"]) || $HTTP_COOKIE_VARS["countcookie"] != $day) {
$your_c=1;
$lockfile=fopen("temp","a");
flock($lockfile,3);
putenv
Ïà¹ØÎĵµ£º
<?
$_mysqlhost="localhost";
$_mysqluser="root";
$_mysqlpass="";
$_mysqldata="mydata";
$_connect=mysql_connect($_mysqlhost,$_mysqluser,$_mysqlpass) or die ("´íÎó".mysql_error());
mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary", $ ......
×î½üÔÚ×öPHPÓëÊý¾Ý¿â½»»¥µÄproject£¬¼±ÓÚÇó³É£¬Ä£·ÂÁËÏÂÀý×ӾͿªÊ¼¶¯ÊÖ£¬½á¹ûÎó°Ñmysql_fetch_arrayд³ÉÁËmysql_fetch_row,囧ÊÂÀ´ÁË£¬·¢ÏÖ·µ»ØµÄÊý×é¾ÓÈ»ÊÇindex=>valueµÄÐÎʽ£¬¶øÃ÷Ã÷¼ÇµÃÊÇfield name=>valueµÄ¹þ£¬²éÊÖ²á²ÅÃ÷°×¡£
1. mysql_fetch_arrayµÄº¯ÊýÔÐÍÊÇ
array mysql_fetch_array ( resour ......
<?
include 'conn.php';
$_pagenob=10; //ÿҳ¹æ¶¨µÄÐÅÏ¢ÊýÄ¿
//»ñÈ¡µ±Ç°Ò³
if(isset($_GET["page"]))
{
$_page = intval( $_GET['page'] );
}
else
{
$_page=1;
}
//²éѯÊý¾Ý×ÜÊý
$_query="select count(*) as acount from news";
$_result=mysql_query($_query);
$_row=mysql_fetch_row($_result);
......
¡¡¡¡ËäÈ»PHPÊÇWebÓ¦Óÿª·¢ÖÐ×î¹ã·ºÊ¹ÓõĻ·¾³£¬µ«Ëü»¹ÊÇÒ»¶È±»ÈÏΪÎÞÔµÆóÒµ¼¶¿ª·¢¡£InfoQ×éÖ¯ÁËÒ»¸öÐéÄâ×ù̸С×éÀ´ÌÖÂÛÓïÑÔ/ƽ̨µÄÑݱ估PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ¡£
¡¡¡¡Zeev Suraski£¬Zend Technologies¹«Ë¾´´Ê¼ÈË£¬¸Ã¹«Ë¾Ö÷Òª¹Ø×¢PHPµÄ½øÕ¹¡£
¡¡¡¡Rob Nicholson£¬¸ß¼¶¼¼ÊõÑÐÔ±, ÔøΪIBM±àд¹ý³ÌÐòÉè¼ÆÓïÑÔÔËÐÐʱ¡£
¡¡¡ ......
×î½üÉÏÍøÕÒÁËһЩ¹ØÓÚ±¸·ÝmysqlÊý¾Ý¿âµÄ·½·¨£¬Ö÷Òª¾ÍÊÇͨ¹ýÍøÒ³µÄ·½·¨µ¼³öÊý¾Ý¿âµÄsql Îļþ£¬ÕÒµ½¸ö²»´íµÄ´úÂ룬µ«·¢ÏÖÖÐÎĵ¼³ö»áÂÒÂ룬ÓÚÊÇÉÔ΢ÐÞ¸ÄÁËһϣ¬ÏÂÃæÊDZ¸·ÝµÄ´úÂë
view plaincopy to clipboardprint?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml ......