+ -
当前位置:首页 → 问答吧 → .php?a=$mykey 页面传递变量时字符串位数少1

.php?a=$mykey 页面传递变量时字符串位数少1

时间:2011-09-04

来源:互联网

A.php
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
..........
$getkw =$_POST['keywords'];
echo strlen($getkw);      //假如接受的keywords=“一中” ,utf-8编码的长度应该为6,这里显示的也是6,说明正确。
If (!is_numeric($getkw))
  {echo " <script> window.location='B.php?a=$mykey';</script>";}

B.php
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
.......
$get_a = $_GET['a'];
echo strlen($get_a);    // 输出 5 ,显然缺少了一位。

请问各位到底错在哪里?

作者: lijh0633   发布时间: 2011-09-04

urlencode()

作者: kuhanzhu   发布时间: 2011-09-04

热门下载

更多