<?php
if($_POST) print_r($_POST);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<form name="form1" method="post" action="">
<input name="textfield" type="text" value="报价×1.2">
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>//output
Array ( [textfield] => 报价×1.2 [Submit] => 提交 ) 不会啊,我的出来是这样子的.
<form >
<input type=text name=t value="报价×1.2">
<input type=submit>
</form>
<?
print_r($_GET); //Array ( [t] => 报价×1.2 )
?>
还是
<form method=post>
<input type=text name=t value="报价×1.2">
<input type=submit>
</form>
<?
print_r($_POST); //Array ( [t] => 报价×1.2 )
?>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
应该与apache无关吧,你提交后存在什么地方,还是直接显示出来?
我把问题说的具体点,看能不能有办法:
1.环境 FreeBSD,apache,php
2.程序用PHPLIB模板方式,HTML摸板含有下句:
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
3.表单提交方式为:POST
4.在处理页面 print_r($_POST); // 结果 Array ( ['subject'] => 报价?.2 ) 是不是这个× 号搞的鬼?怎么办?
你的"×"是中文吗?
程序中加个:
header("Content-type: text/html;charset=GB2312");
试试
加上去没有用。
header("Content-type: text/html;charset=UTF-8");
or
header("Content-type: text/html;charset=GBK");