如题所示.百度了下,说是名字一样,但ID不同,通过数组来解决。但是我还是不得要领。先把切换的代码发上。
<form method="post" action="page-10.php">
<h3>你要进行的管理操作:</h3>
<label for="n1" class="red"><input name="myradio" id="n1" type="radio" value="alter" checked="checked" onclick="radioShow();" />修改</label>
<label for="n2" class="red"><input name="myradio" id="n2" type="radio" value="delete" onclick="radioShow();" />删除</label>
<label for="n3" class="red"><input name="myradio" id="n3" type="radio" value="add" onclick="radioShow();" />添加</label> //该部分为单选框
------------------------------------------------------------------------------------
<div id="c">
<div class="c1">
<label for="aim">需要修改的书籍编号:<input name="cx[]" id="aim" type="text" value="" /></label><br/><br/>
<label for="title">书名<input name="cx[]" id="title" type="text" value="" /></label><br/><br/>
<label for="type">语言<input name="cx[]" id="type" type="text" value="" /></label><br/><br/>
<label for="author">作者<input name="cx[]" id="author" type="text" value="" /></label><br/><br/>
<label for="category">类别<input name="cx[]" id="category" type="text" value="" /></label><br/><br/>
<label for="numeber">书名<input name="cx[]" id="number" type="text" value="" /></label><br/><br/>
<label for="ok"><input name="cx" id="ok" type="submit" value="确定" /></label>
</div>
//这部分属于修改的几个文本框
------------------------------------------------------------------------------------
<div class="c2" style="display:none;">
<label for="goal">需要删除的书籍编号:<input name="cy" id="goal" type="text" value="" /></label>
<label for="yes"><input name="cy" id="yes" type="submit" value="确定" />
</div>
//删除的文本框
------------------------------------------------------------------------------------
<div class="c3" style="display:none;">
<label for="target">书籍编号:<input name="cz[]" id="atarget" type="text" value="" /></label><br/><br/>
<label for="atitle">书名<input name="cz[]" id="atitle" type="text" value="" /></label><br/><br/>
<label for="atype">语言<input name="cz[]" id="atype" type="text" value="" /></label><br/><br/>
<label for="aauthor">作者<input name="cz[]" id="aauthor" type="text" value="" /></label><br/><br/>
<label for="acategory">类别<input name="cz[]" id="acategory" type="text" value="" /></label><br/><br/>
<label for="anumeber">书名<input name="cz[]" id="anumber" type="text" value="" /></label><br/><br/>
<label for="aok"><input name="cz" id="aok" type="submit" value="确定" /></label>
</div>
//这部分是添加的几个文本框------------------------------------------------------------------------------------
</div>
</form>
<form method="post" action="page-10.php">
<h3>你要进行的管理操作:</h3>
<label for="n1" class="red"><input name="myradio" id="n1" type="radio" value="alter" checked="checked" onclick="radioShow();" />修改</label>
<label for="n2" class="red"><input name="myradio" id="n2" type="radio" value="delete" onclick="radioShow();" />删除</label>
<label for="n3" class="red"><input name="myradio" id="n3" type="radio" value="add" onclick="radioShow();" />添加</label> //该部分为单选框
------------------------------------------------------------------------------------
<div id="c">
<div class="c1">
<label for="aim">需要修改的书籍编号:<input name="cx[]" id="aim" type="text" value="" /></label><br/><br/>
<label for="title">书名<input name="cx[]" id="title" type="text" value="" /></label><br/><br/>
<label for="type">语言<input name="cx[]" id="type" type="text" value="" /></label><br/><br/>
<label for="author">作者<input name="cx[]" id="author" type="text" value="" /></label><br/><br/>
<label for="category">类别<input name="cx[]" id="category" type="text" value="" /></label><br/><br/>
<label for="numeber">书名<input name="cx[]" id="number" type="text" value="" /></label><br/><br/>
<label for="ok"><input name="cx" id="ok" type="submit" value="确定" /></label>
</div>
//这部分属于修改的几个文本框
------------------------------------------------------------------------------------
<div class="c2" style="display:none;">
<label for="goal">需要删除的书籍编号:<input name="cy" id="goal" type="text" value="" /></label>
<label for="yes"><input name="cy" id="yes" type="submit" value="确定" />
</div>
//删除的文本框
------------------------------------------------------------------------------------
<div class="c3" style="display:none;">
<label for="target">书籍编号:<input name="cz[]" id="atarget" type="text" value="" /></label><br/><br/>
<label for="atitle">书名<input name="cz[]" id="atitle" type="text" value="" /></label><br/><br/>
<label for="atype">语言<input name="cz[]" id="atype" type="text" value="" /></label><br/><br/>
<label for="aauthor">作者<input name="cz[]" id="aauthor" type="text" value="" /></label><br/><br/>
<label for="acategory">类别<input name="cz[]" id="acategory" type="text" value="" /></label><br/><br/>
<label for="anumeber">书名<input name="cz[]" id="anumber" type="text" value="" /></label><br/><br/>
<label for="aok"><input name="cz" id="aok" type="submit" value="确定" /></label>
</div>
//这部分是添加的几个文本框------------------------------------------------------------------------------------
</div>
</form>
解决方案 »
- wamp中怎么打开PHP文件总是弹出 “文件下载”对话框
- PHP soap通信时http请求默认Content-Type=soap+xml,怎么修改成text/xml
- dede插入数据重复,什么原因?
- 关于php与xhtml、div+css,高手入
- CURL目标网页有javascript跳转.取不到源码.
- JS动态添加表单和取值的疑问。
- 请教,多个图片同时上传的问题
- 天空软件站是如何使用静态页面处理动态内容的
- 对于数组的数组,怎样用in_array判断一个变量是否在最后的子数组中?
- 求助!MYSQL的INSERT问题
- Fatal error: Class 'mysqli' not found in F:\apache\Apache2\htdocs\……
- php哪个环境出问题了,现在必须加密才能用
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
$cx=$_POST['cx'];
echo "$cx[1]";
?>
</body>
</html>
得到的结果就是个框框,说是乱码也不对,因为改成$cx[2]或者是$cx[0]都是同样的结果。
print_r($_POST);
看看都有些什么
谢谢咯,版主总能看到你的身影。麻烦你了。
我是半路出家,学校这学期没有开这门课,而这学期又有一个关于数据库的课程设计,我就要用到这个。马马虎虎把php的语法看了(可能学了C和C++,感觉还是很难容易上手),就开始着手课程设计了,反正是用到什么学什么,一点也不扎实,决定在暑假专门找些书系统学习下。
但是很迷茫学习的路线。我先说说我的看法。
html--->css---->php---->js
版主,看下,这样可以不?
---->php