Chinaunix首页 | 论坛 | 博客
  • 博客访问: 694113
  • 博文数量: 143
  • 博客积分: 1554
  • 博客等级: 上尉
  • 技术积分: 1767
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-10 11:50
文章分类

全部博文(143)

文章存档

2017年(2)

2016年(5)

2015年(16)

2014年(25)

2013年(27)

2012年(16)

2011年(52)

分类: PHP

2014-12-10 15:23:16

1.html页面

点击(此处)折叠或打开

  1. <html>
  2.     <head>
  3.         <meta charset="UTF-8">
  4.         <title></title>
  5.     </head>
  6.     <body>
  7.         
  8.         <?php require '12.php'; ?>
  9.         <input type="text" name="string" value="" />
  10.         <button onclick="location.reload();">单击刷新页面</button>
  11.        
  12.     </body>
  13. </html>

2.PHP页面

点击(此处)折叠或打开

  1. <?php
  2. header("Content-type:text/html;charset=utf-8");
  3.     
  4.     function genRandomString($len){
  5.         $chars = array( "一","二","三","四","五",'六','七','八','九',"十");
  6.         $output="";
  7.         for($i=0;$i<$len;$i++){
  8.             $index = array_rand($chars);
  9.             $output.= $chars[$index];
  10.         }
  11.         return $output;
  12.     }

阅读(1172) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~