源码论坛,商业源码下载,尽在锦尚中国商业源码论坛

标题: 求助,表单提交好是乱码... [打印本页]

作者: umss7301    时间: 2016-1-14 15:35
标题: 求助,表单提交好是乱码...
这是一个祝福网页,提交名字后显示的是乱码,请高手帮我看下代码那里错了,从早上鼓捣到现在也没有找出问题来...拜托了{:2_220:} !!!
============================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>生日祝福网页</title>
<SCRIPT language="javascript">
  var lusername =location.search.split("=")[1];
  if(!lusername){
  lusername="小王";
  }
  else{
  lusername=unescape(lusername);
  }

  function check(obj){
  if (obj.stra.value.length>8) {
  alert('太长');
  return false;
  }
  if (obj.stra.value.length==0) {
  alert('还没填写姓名呀');
  return false;
  }
  var url="http://"+location.host+location.pathname+"?stra="+escape(obj.stra.value);

  window.clipboardData.setData("Text",url);
  alert('网址已生成并替您复制好了,直接粘贴到QQ或邮箱就可以了\n\n您的朋友 一定会很惊喜,快快发送吧!');
  window.location.replace(url);
  return false;
  }
</SCRIPT>
</head>

<body>
<table width="600" border="0" align="center">
  <tr>
    <td><SCRIPT>document.write(lusername)</SCRIPT>:祝福你节日快乐!</td>
  </tr>
  <tr>
    <td><img src="http://pic17.nipic.com/20111110/3992420_192949023336_2.jpg" width="640" height="480" /></td>
  </tr>
  <tr>
    <td><div align="center">在空白处写上朋友的名字,再点《点此提交》</div></td>
  </tr>
  <tr>
    <td>
<form  name="newinfo_form">
<p align="center">
<input id="stra" style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体" tabIndex"1" maxLength="8" size="16" name="name">
<font size="4" style="line-height: 150%; word-break: break-all">
<input style="FONT-FAMILY: 宋体" type="submit" value="点此提交" name="Submit">
</font></p>
</form>
    </td>
  </tr>
</table>
</body>
</html>
====================

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  5. <title>生日祝福网页</title>
  6. <SCRIPT language="javascript">
  7.   var lusername =location.search.split("=")[1];
  8.   if(!lusername){
  9.   lusername="小王";
  10.   }
  11.   else{
  12.   lusername=unescape(lusername);
  13.   }

  14.   function check(obj){
  15.   if (obj.stra.value.length>8) {
  16.   alert('太长');
  17.   return false;
  18.   }
  19.   if (obj.stra.value.length==0) {
  20.   alert('还没填写姓名呀');
  21.   return false;
  22.   }
  23.   var url="http://"+location.host+location.pathname+"?stra="+escape(obj.stra.value);

  24.   window.clipboardData.setData("Text",url);
  25.   alert('网址已生成并替您复制好了,直接粘贴到QQ或邮箱就可以了\n\n您的朋友 一定会很惊喜,快快发送吧!');
  26.   window.location.replace(url);
  27.   return false;
  28.   }
  29. </SCRIPT>
  30. </head>

  31. <body>
  32. <table width="600" border="0" align="center">
  33.   <tr>
  34.     <td><SCRIPT>document.write(lusername)</SCRIPT>:祝福你节日快乐!</td>
  35.   </tr>
  36.   <tr>
  37.     <td><img src="http://pic17.nipic.com/20111110/3992420_192949023336_2.jpg" width="640" height="480" /></td>
  38.   </tr>
  39.   <tr>
  40.     <td><div align="center">在空白处写上朋友的名字,再点《点此提交》</div></td>
  41.   </tr>
  42.   <tr>
  43.     <td>
  44. <form  name="newinfo_form" onSubmit="return check(this)">
  45. <p align="center">
  46. <input id="stra" style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体" tabIndex"1" maxLength="8" size="16" name="name">
  47. <font size="4" style="line-height: 150%; word-break: break-all">
  48. <input style="FONT-FAMILY: 宋体" type="submit" value="点此提交" name="Submit">
  49. </font></p>
  50. </form>
  51.     </td>
  52.   </tr>
  53. </table>
  54. </body>
  55. </html>
复制代码

作者: umss7301    时间: 2016-1-17 22:01
我以为在这里可得到帮助...




欢迎光临 源码论坛,商业源码下载,尽在锦尚中国商业源码论坛 (https://bbs.52jscn.com/) Powered by Discuz! X3.3