<?php
if($action == '')
{
echo '<div id="panelTitle">新增数据</div><br />';
echo '<form name="formEditItem" method="post" action="addtest.php?action=add">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B0C5FF">
<tr>
<th bgColor=#cedcff height=20 align="left"> Item</th>
<th bgColor=#cedcff height=20 align="left"> Value</th>
</tr>'; for ($i=1; $i < 17; $i++)
{
echo '<tr class="cells" onmouseover="this.className=\'cells2\'" onmouseout="this.className=\'cells\'">';
echo '<td width=200 align="left">'."Label_2D_Code".'</td>';
echo '<td align="left"> <input type="text" value="'.$var.'" name="'.$i.'" size="80" onMouseOver="this.focus()" /></td>';
echo '</tr>';
}
echo '</table><br />';
echo '<input name="btnEditOK" type="submit" title="Submit" class="btnbig" value="提交" onclick="javascript:submit();" onmouseover="this.className=\'btnbig_over\'" onMouseOut="this.className=\'btnbig\'" onMouseDown="this.className=\'btnbig_down\'" onMouseUp="this.className=\'btnbig\'" />
<input name="btnEditReset" type="reset" title="Drop and Reset" class="btnbig" value="重置" onmouseover="this.className=\'btnbig_over\'" onMouseOut="this.className=\'btnbig\'" onMouseDown="this.className=\'btnbig_down\'" onMouseUp="this.className=\'btnbig\'" />';
}
?>
print_r($_POST);
能否在输出的时候,判断有重复的值并提示警告?
解决方案 »
- 紧急求助,网站被人给自动发链接了。
- Digest HTTP Authentication 一问
- 这个功能是怎么实现的?
- 求一个简单点的php上传的类文件,最好详细点
- js 面向对象编程的静态属性和静态方法,实例属性和方法分别是什么?
- 关于ewebedit编辑器问题,在线等!
- 谁有flashfxp3.0以上版本的注册码给我一个好吗?急啊~~~
- 从使用效率和扩展性来说在进行典型web开发的时候,用php还是jsp?
- 请问大家:PHP+MYSQL+APACHE 在win2k下如何搭配平台?在线等待
- 请问谁能给我一个这个帖子里提到的 data_big5.php
- php的json_encode莫灰有问题
- phpmyadmin的问题
print_r(array_flip(array_flip($ar)));Array ( [0] => 1 [1] => 2 [6] => 3 [5] => 4 [4] => 5 )
这样也是可以的。我只要保留一个不重复就行了。但是之前对应的input框的值会不会变成空值?
$ar = array(1,2,3,4,5,4,3);
$num1 = count($ar);
$arr=array_flip(array_flip($ar));
$num2 = count($arr);
if($num1 != $mum2)
{
echo "重复";
}