PHP¼òµ¥¼ÆÊýÆ÷
<?php
/*ʹÓÃÎı¾Îļþ¼Ç¼Êý¾ÝµÄ¼òµ¥ÊµÏÖ*/
$counter=1;
if(file_exists("mycounter.txt")){
$fp=fopen("mycounter.txt","r");
$counter=fgets($fp,9);
$counter++;
fclose($fp);
}
$fp=fopen("mycounter.txt","w");
fputs($fp,$counter);
fclose($fp);
echo "<h1>ÄúÊǵÚ".$counter."´Î·ÃÎʱ¾Ò³Ã棡<h1>";
?>
<?php
//ÏÂÃæÕâ¸öΪʹÓûùÓÚÊý¾Ý¿âµÄ¼òµ¥¼ÆÊýÆ÷£¬Î´Ìí¼ÓÆäËû·ÀÖ¹Ò»ÈËÖØ¸´Ë¢Ðµķ½·¨¡£½ö¹©²Î¿¼¡£¡£
$conn=mysql_connect("localhost","root","abc");
$result=mysql_query("use db_counter");
$re=mysql_query("select * from tb_counter");
$result=mysql_fetch_row($re);
$counter=$result[0];
echo "ÄúÊǵÚ{$counter}λ·ÃÎÊÕߣ¡";
$counter+=1;echo "<hr>{$counter}";
mysql_query("update tb_counter set counter=$counter");
mysql_close($conn);
?>
Ïà¹ØÎĵµ£º
1²éÕÒ×Ö·ûλÖú¯Êý£º
strpos($str,search,[int]):²éÕÒsearchÔÚ$strÖеĵÚÒ»´ÎλÖôÓint¿ªÊ¼£»
stripos($str,search,[int]):º¯Êý·µ»Ø×Ö·û´®ÔÚÁíÒ»¸ö×Ö·û´®ÖеÚÒ»´Î³öÏÖµÄλÖ᣸ú¯Êý¶Ô´óСд²»Ãô¸Ð
strrpos($str,search,[int]):²éÕÒsearchÔÚ$strÖеÄ×îºóÒ»´Î³öÏÖµÄλÖôÓint
2¡¢ÌáÈ¡×Ó×Ö·ûº¯Êý£¨Ë«×Ö½Ú£©
subm ......
ÆÕͨPHP³ÌÐòÔ±±ÊÊÔÌâ
1. ÓÃPHP´òÓ¡³öǰһÌìµÄʱ¼ä£¬´òÓ¡¸ñʽÊÇ2007Äê5ÔÂ10ÈÕ 22:21:21
2. PHP´úÂëÈçÏ£º
$a="hello";
$b=&$a;
unset($b);
$b="world";
echo $a;
Æä½á¹ûÊÇ£¿
3. PHP´úÂëÈçÏ£º
$str="cd";
$$str="landog";
$$st ......
1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó {3RY4HVT?
¸ñʽ£º Fv n:V\eb
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]]) _I;+p eq
Àý£º 1(V>8}zn
$conn = @mysql_connect("localhost", "username", "password") or dir(" ......
asp,asp.net,php,jspϵÄ301תÏò´úÂë
ʹÓÃ.htaccessÎļþÀ´½øÐÐ301ÖØ¶¨Ïò¡£
Èç¹û¿Õ¼ä²»Ö§³Ö.htaccessÎļþ£¬ÄÇôÎÒÃÇ»¹¿ÉÒÔͨ¹ýphp/asp´úÂëÀ´½øÐÐ301ÖØ¶¨Ïò¡£
ΪÁ˽«ËÑË÷ÒýÇæµÄ¼Ç¼¸üе½ÏÖÔÚµÄÓòÃûÉÏÃæ,×öÁ˼¸¸ö301ÖØ¶¨ÏòµÄ¶«¶«,¸ø´ó¼Ò·ÖÏíÒ»ÏÂ.
asp 301תÏò´úÂë
ÔÚ index.asp »ò default.asp µÄ×î¶¥²¿¼ÓÈëÒÔ ......
1¡¢$_SERVER['SCRIPT_NAME']¡¢$_SERVER['PHP_SELF']ºÍ$_SERVER['REQUEST_URI']Çø±ð
Àý×Ó:http://localhost/phpwind75/test.php/%22%3E%3Cscript%3Ealert(’xss’)%3C/script%3E%3Cfoo
$_SERVER['SCRIPT_NAME']Ö»»ñÈ¡½Å±¾Ãû£¬²»»ñÈ¡²ÎÊý,Êä³ö½á¹ûΪ:test.php;
$_SERVER['PHP_SELF']»ñÈ¡½Å±¾Ãûºó£¬Í¬Ê±»ñÈ ......