如题所示.百度了下,说是名字一样,但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>
<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