PHPÁ¬½ÓMysqL
Á¬½Ó£º
$conn=mysql_connect ("localhost:3306", "username", "password");
mysql_select_db("DBname");
¶Á£º
$exec="select * from stu";
$result=mysql_query($exec);
while($rs=mysql_fetch_object($result))
{
echo $rs->id." ".$rs->name." ".$rs->age." ".$rs->sex;
echo "<br>";
}
Ïà¹ØÎĵµ£º
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']»ñÈ¡½Å±¾Ãûºó£¬Í¬Ê±»ñÈ ......
<?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."´Î·ÃÎʱ¾Ò³ ......
includeʵÏÖ¹ú¼Ê»¯
½«index.php½øÐзÒë:
IndexÄÚÈÝ
1. Index
2. About us
ÎÒÃÇ¿ÉÒÔ½«index.phpÉèÖÃΪһ¸ö·ÒëÄ£°æ£¬ËùÓгöÏÖ×Ö·ûµÄµØ·½£¬¶¼¶¨ÒåΪ±äÁ¿£¬Èç1£¬2²¿·ÖÉèÖÃΪ·ÒëµÄ±äÁ¿$menu_index, $menu_aboutus.
......
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......
1¡¢Êý×éµÄÉêÇëºÍʹÓãº
$array=array(array(2,324,34));
echo $array[0][1];
Ö±½ÓÉêÇëʹÓãº
$student[0][0]="ÎÒ";
$student[0][1]="ÊÇ";
$student[1][0]="Ë";
$student[1][1]="ά";
echo $student[1][0];
2¡¢±éÀú£º ......