mysql传值问题

WBOY
Release: 2016-06-23 13:34:49
Original
916 people have browsed it

我做了一个下拉菜单关联 代码如下
<script> <br /> mokuainame=new Array(15); <br /> mokuaicode=new Array(15); <br /> function first(preB,preM,formname,bumen,keudimokuai) <br /> { <br /> a=0; <br /> if (bumen=='01') <br /> { a=1;tempoption=new Option('东区安检部','01',false,true); } <br /> else <br /> { tempoption=new Option('东区安检部','01'); } <br /> eval('document.'+formname+'.'+preB+'.options[1]=tempoption;'); <br /> mokuaicode[0]=new Array('0101','0102','0103','0104','0105','0106'); <br /> mokuainame[0]=new Array('东区一科','东区二科','东区三科','东区四科','行检科','办公室'); <br /> if (bumen=='02') <br /> { a=2;tempoption=new Option('西区安检部','02',false,true); } <br /> else <br /> { tempoption=new Option('西区安检部','02'); } <br /> eval('document.'+formname+'.'+preB+'.options[2]=tempoption;'); <br /> mokuaicode[1]=new Array('0201','0202','0203','0204','0205'); <br /> mokuainame[1]=new Array('西区一科','西区二科','西区三科','西区四科','办公室'); <br /> <br /> eval('document.'+formname+'.'+preB+'.options[a].selected=true;'); <br /> <br /> bumenid=bumen; <br /> if (bumenid!='0') <br /> { <br /> b=0;for (i=0;i<mokuainame[bumenid-1].length;i++) <br /> { <br /> if (keduimokuai==mokuaicode[bumenid-1][i]) <br /> {b=i+1;tempoption=new Option(mokuainame[bumenid-1][i],mokuaicode[bumenid-1][i],false,true);} <br /> else <br /> tempoption=new Option(mokuainame[bumenid-1][i],mokuaicode[bumenid-1][i]); <br /> eval('document.'+formname+'.'+preM+'.options[i+1]=tempoption;'); <br /> } <br /> eval('document.'+formname+'.'+preM+'.options[b].selected=true;'); <br /> } <br /> } <br /> function selectmokuai(preB,preM,formname) <br /> { <br /> bumenid=eval('document.'+formname+'.'+preB+'.selectedIndex;'); <br /> j=eval('document.'+formname+'.'+preM+'.length;'); <br /> for (i=1;i<j;i++) <br /> {eval('document.'+formname+'.'+preM+'.options[j-i]=null;')} <br /> if (bumenid!="0") <br /> { <br /> for (i=0;i<mokuainame[bumenid-1].length;i++) <br /> { <br /> tempoption=new Option(mokuainame[bumenid-1][i],mokuaicode[bumenid-1][i]); <br /> eval('document.'+formname+'.'+preM+'.options[i+1]=tempoption;'); <br /> } <br /> } <br /> } <br /> </script>


科队/模块 :


php传值到mysql
$bumen = $_POST['bumen'];
$keduimokuai = $_POST['keduimokuai'];
部门和科队这两项 存的是01和0101 不存中文 怎么办?求解?


回复讨论(解决方案)

你提交的不就是 01和0101 吗?

我想提交中文 但是逻辑有点转不过来了 怎么改



$keduimokuai = $_POST['keduimokuai'];//提交的内容

怎样改才能传中文 目前还是只能穿mokuaicode 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template