笔记 网页

<link type="text/css" rel="sytlesheet" href="">


/*清楚格式*/
body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div,dl,dt,dd,input{margin: 0; padding: 0;}
body{font-size:12px;}
img{border:none;}
li{list-style:none;}
input,select,textarea{outline:none;}
textarea{resize:none;}
a{text-decoration:none;}


/*清浮动*/
.clearfix:after{content:""; display:block; clear:both;}
.clearfix{zoom:1;}


//php插入中文错误怎么设置
在相关页面
mysql_query("set names 'gbk'");//格式与php一致


/*网页之间的传值*/
<a href="projectInfo.php?id=<?php echo $row['id'];?>">查看</a>


两个submit 通过js传值到action页面
<?php 
require_once "mysql.func.php";
header("content-type:text/html;charset=utf-8");
connect();
$sql="select * from project";
$rows=fetchAll($sql);
if(!$rows){
echo "<script>alert('sorry,没有项目信息!')</script>";
echo "<script>window.location='addAdmin.php';</script>";
exit;
}
?>

<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title>物流项目信息维护</title>
<link href="css/reset.css" rel="stylesheet" type="text/css">
<link href="css/main.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="headerBar">
<div class="topBar">
<div class="comWidth">
<div class="leftArea">
<a href="#" class="collection">收藏网站</a>
</div>
<div class="rightArea">
欢迎您:xxd <a href="#">[登陆]</a><a href="#">[免费注册]</a>
</div>
</div>
</div>
<div class="logoBar">
<div class="comWidth">
<div class="logo fl">
<a href="#">
<img src="img/logo.gif" alt="系统">
</a>
</div>
<div class="search_box fl">
<input type="text" class="search_text fl" />
<input type="button" value="搜 索" class="searct_btn fr" />
</div>
</div>
</div>
<div class="navBox">
<div class="comWidth">
<div class="nav_cont">
<ul class="nav fl">
<li><a href="index.php">首页</a></li>
<li><a href="publish.php">项目发布</a></li>
<li><a href="shenpi.php">项目审批</a></li>
<li><a href="edit.php" class="active">项目修改</a></li>
<li><a href="stop.php">项目停用</a></li>
</ul>
</div>
</div>
</div>
</div>
<table width="60%" border="0" cellpadding="2" cellspacing="0" class="tabmid">
<tr>
<td width="10%" nowrap class="inputHeader">关键字</td>
<td width="23%" class="inputContent">
<input name="tittle" type="text" class="text width100">
</td>
<td width="10%" nowrap class="inputHeader">区域</td>
<td width="23%" class="inputContent">
<select name="area">
<option>东北</option>
<option>西北</option>
<option>北方</option>
<option>西南</option>
<option>南方</option>
<option>华东</option>
<option>华中</option>
</select>
</td>
<td width="10%" class="inputHeader">发布单位</td>
<td width="23%" class="inputContent">
<input name="people" type="text" class="text width100">
</td>
</tr>
<tr>
<td nowrap class="inputHeader">更新时间</td>
<td class="inputContent">&nbsp; </td>
<td class="inputHeader">行业</td>
<td class="inputContent">
<select name="pub">
<option>制造
<option>能源
<option>运输
<option>工程
<option>食品
</select>
</td>
<td class="inputHeader">&nbsp;</td>
<td class="inputContent">&nbsp;</td>
</tr>
<tr align="right">
<td colspan="6" class="inputContent">
<input class="button" type="button" value=" 查 询 " name="btnsearch">
</td>
</tr>
</table>
<form action="" method="post">
<table width="60%" border="0" cellpadding="2" cellspacing="1" class="midTable1">
<tr class="midTable1td1">
<td width="1%">&nbsp;</td>
<td width="22%">更新时间</td>
<td>区域</td>
<td>行业</td>
<td>项目名称</td>
<td>项目状态</td>
<td width="24%">发布单位</td>
</tr>
<?php foreach($rows as $row):?>
<tr class="midTable1td2">
<td align="center"><input type="radio" name="<?php echo $row['id'];?>" value="<?php echo $row['id'];?>" /></td>
<td align="center"><?php echo $row['pTime'];?></td>
<td align="center"><?php echo $row['pArea'];?></td>
<td align="center"><?php echo $row['pJob'];?></td>
<td align="center"><?php echo $row['pTitle'];?></td>
<td align="center">
<?php 
if($row['pType']==0) echo "发布";
else if($row['pType']==1) echo "审批";
else if($row['pType']==2) echo "停用";
?>
</td>
<td align="center"><?php echo $row['pWork'];?></td>
</tr>
<?php endforeach;?>
<tr class="midTable1td3">
<td colspan="7"><a href="#">上一页 </a><a href="#">下一页</a></td>
</tr>
<tr class="midTable1td4">
<td colspan="7" align="right">
<input name="editbtn" type="submit" class="button" value="修改">
<input name="delbtn" type="submit" class="button" value="删除">
</td>
</tr>
</table>
</form>
</body>
</html>
<?php 
if(isset($_POST['editbtn'])){
while(list($name,$value)=each($_POST))
{
if ($name!='editbtn'){
if($name!='editbtn'){
echo "<script>window.location='doEdit.php?id='+$value;</script>";
}
}
}
}
if(isset($_POST['delbtn'])){
echo "<script>alert('删除!');</script>";
}
?>

end 两个submit 通过js传值到action页面


<?php
require_once 'mysql.func.php';


$sql="select id,username from xxd_admin limit {$offset},{$pageSize}";
$rows=fetchAll($sql);
if(!$rows){
echo "<script>alert('sorry,没有管理员!')</script>";
echo "<script>window.location='addAdmin.php';</script>";
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理员列表</title>
</head>
<body>
<h3>管理员列表</h3>
<table width="70%" border="1" cellpadding="5" cellspacing="0" bgcolor="#ccc" align="center">
<thead>
<tr>
<td width="15%"></td>
<td width="60%">管理员名称</td>
<td>操作</td>
</tr>
</thead>
<tbody>
<?php foreach($rows as $row):?>
<tr>
<td><?php echo $row['id'];?></td>
<td><?php echo $row['username'];?></td>
<td><input type="button" name="edit" value="修改" οnclick="editAdmin(<?php echo $row['id'];?>)"/><input type="button" name="del" value="删除" οnclick="delAdmin(<?php echo $row['id'];?>)"/></td>
</tr>
<?php endforeach;?>
<?php if($rows>$pageSize):?>
<tr>
<td colspan="3"><?php echo showPage($page,$totalPage);?></td>
</tr>
<?php endif;?>
</tbody>
</table>
</body>
</html>
<script type="text/javascript">
function editAdmin(id){
window.location="editAdmin.php?id="+id;
}
function delAdmin(id){
if(window.confirm("您确定要删除吗?")){
window.location="doAdminAction.php?act=delAdmin&id="+id;
}
}
</script>


=========
<html>
<head>
<script>
function submitit1()
//交由程序1处理     
{
document.myForm.action = "http://www.site.com/cgi1.php"
document.myForm.submit();
}
function submitit2()
//交由程序2处理     
{
document.myForm.action = "http://www.site.com/cgi2.php"
document.myForm.submit();
}
</script>
</head>


<body>
<form name="myForm" METHOD=POST>
username:<input type=text name=text1> 
password:<input type=password name=text2>
<input type=button value="Submit1" onClick=submitit1();>
<input type=button value="Submit2" onClick=submitit2();>
</form>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值