没有合适的资源?快使用搜索试试~ 我知道了~
php基础:将查询结果保存到Excel
4星 · 超过85%的资源 需积分: 9 158 下载量 28 浏览量
2013-04-21
18:50:28
上传
评论 5
收藏 5KB TXT 举报
温馨提示
试读
6页
php基础:将查询结果保存到Excel
资源推荐
资源详情
资源评论
index.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>将查询结果保存到Excel</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<script>
function chkinput(form){
if(form.sno.value==""){
alert("请输入学生学号!");
form.sno.select();
return(false);
}
return(true);
}
</script>
<body>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/top.gif" width="636" height="97" /></td>
</tr>
</table>
<table width="636" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" background="images/center.gif">
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>将查询结果保存到Excel</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<script>
function chkinput(form){
if(form.sno.value==""){
alert("请输入学生学号!");
form.sno.select();
return(false);
}
return(true);
}
</script>
<body>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/top.gif" width="636" height="97" /></td>
</tr>
</table>
<table width="636" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" background="images/center.gif">
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#CDEF27">
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="1">
<form name="form1" method="post" action="index.php" onsubmit="return chkinput(this)">
<tr>
<td bgcolor="#FFFFFF"><div align="center">请输入学号:
<input type="text" name="sno" size="25" class="inputcss">
<input type="submit" name="submit" value="查找" class="buttoncss"></div></td>
</tr>
</form>
</table></td>
</tr>
</table>
<table width="500" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<?php
if($_POST[submit]!="" || $_GET[id]!="")
{
$sno=$_POST[sno];
if($_GET[sno]!=""){
$sno=$_GET[sno];
}
include_once("conn.php");
$sql=mysql_query("select * from tb_score where sno like '%".$sno."%'",$conn);
$info=mysql_fetch_array($sql);
if($info==false)
{
<td bgcolor="#CDEF27">
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="1">
<form name="form1" method="post" action="index.php" onsubmit="return chkinput(this)">
<tr>
<td bgcolor="#FFFFFF"><div align="center">请输入学号:
<input type="text" name="sno" size="25" class="inputcss">
<input type="submit" name="submit" value="查找" class="buttoncss"></div></td>
</tr>
</form>
</table></td>
</tr>
</table>
<table width="500" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<?php
if($_POST[submit]!="" || $_GET[id]!="")
{
$sno=$_POST[sno];
if($_GET[sno]!=""){
$sno=$_GET[sno];
}
include_once("conn.php");
$sql=mysql_query("select * from tb_score where sno like '%".$sno."%'",$conn);
$info=mysql_fetch_array($sql);
if($info==false)
{
剩余5页未读,继续阅读
u010369248
- 粉丝: 1
- 资源: 116
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页