网站建设资讯

NEWS

网站建设资讯

php程序设计经典300例,第6-10例

第6列

echo "index.php

";
echo "_FILE_:"._FILE_."
";
echo "request_uti:".$_SERVER["request_urt"]."
";
echo "script_name:".$_SERVER["script_name"]."
";
echo "php_self:".$_SERVER["php_self"]."
";
echo "script_filename:".$_SERVER["script_filename"]."
";
?>
第7列

$str="0123456789abcdefghijklmnopqrstuvwxyz";
$n=5; //字符长度
$len=strlen($str)-1;
for($i=0;$i<$n;$i++)
  {
  $s = $s.$str[rand(0,$len)];
    
  }
  echo $s."
";
?>
第8列

$a='it1994.cn';
  
  echo "直接输出:".$a;
  echo "
";
  echo "直接输出:".'$a';
  echo "
";  
  echo "直接输出:"."$a";
?>
第9列

index.php页面:

  echo "常见的原子操作";
  echo "执行增加操作
";
   echo "执行删除操作
";
   echo "执行查找操作
";
   echo "执行更新操作
";
   ?>

check.php页面:

   $action=$_GET["action"];
   switch($action)
   {
    case "add";
        echo "";
    break;
    case "del";
        echo "";
    break;
    case "search";
        echo "";
    break;
    case "update";
        echo "";
    break;
   }
?>
第10列
index.php页面:



   it1994.cn
  
    


        message
        
    

  
  


check.php页面:  

     $urlar=parse_url($_SERVER['http_referer']);
     print("
");
     print_r($urlar);
     print_r($_SERVER['http_referer']);
       if($urlar['host']!="172.0.0.1")
         {
            echo "页面失效";
            echo "