澳门新葡亰官网app 1

DBM的同窗录程序,的左右滚动

By admin in 澳门新葡亰官网app on 2019年7月23日

Linux(Ubuntu平台)JSP经过JDBC连接MySQL数据库,与Windows平台类似,步骤如下:

层(div或table)的左右轮转

本条同桌录原本给大家班级用的,因为服务器并未有mysql协助,就分选了dbm
国内还尚未什么样dbm程序,外国也大概从不
花了二个晚上,在差十分的少未有别的参照他事他说加以考察的情形下写了出去
未来宣布出来
是七个特别好的dbm使用楷模

下载 jdbc: mysql-connector-java-5.1.18.tar.gz

 <script language=”javascript”>
function MM_setIMG(w,h,d) {
  if (w==null) {w=0}
  if (h==null) {h=0}
  if (w<=h){ if (h>=114 || h==0) {d.height=114}}else{ if
(w>=114 || w==0) {d.width=114}}
}
   </script>
   <table width=”558″ border=”0″ align=”center” cellpadding=”0″
cellspacing=”1″ bgcolor=”#CCCCCC”>
    <tr>
     <td bgcolor=”#FFFFFF” style=”padding-left:2px”>
      <div id=”demoz” style=”overflow:hidden;width:550;”>
       <table border=”0″ align=”left” cellpadding=”0″ cellspacing=”0″
cellspace=”0″>
        <tr>
         <td id=”demo1z” valign=”top”>
          <table border=”0″ align=”left” cellpadding=”0″
cellspacing=”0″ cellspace=”0″>
           <tr>
            <td valign=”top”><table width=”150″ border=”0″
cellspacing=”0″ cellpadding=”0″>
              <tr>
               <td width=”150″ align=”center”><A
href=”../featuredproducts/product_jump.asp?product_id=7201″><img
src=””
border=”0″
                  onLoad=”javascript:MM_setIMG(this.width,this.height,this)”></A></td>
              </tr>
              <tr>
               <td><TABLE width=”98%” border=”0″ align=”center”
cellpadding=”0″ cellspacing=”0″ bgcolor=”#F2F2F2″
                 style=”BORDER-COLLAPSE: collapse”>
                 <TR>
                  <TD width=”8%” bgColor=”#ffffff”
height=”25″><IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″></TD>
                  <TD bgColor=”#ffffff” height=”25″>
                   <A
href=”../featuredproducts/product_jump.asp?product_id=7201″>Gucci
High Heel ….</A></TD>
                 </TR>
                 <TR>
                  <TD width=”8%” bgColor=”#ffffff”
height=”25″><IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″></TD>
                  <TD bgColor=”#ffffff”
height=”25″>Cole Hann高跟系带凉鞋</FONT></TD>
                 </TR>
                 <TR>
                  <TD align=”middle” colSpan=”2″ height=”12″>
                   <table width=”100%” border=”0″ cellspacing=”0″
cellpadding=”0″>
                    <tr>
                     <TD width=”44%” bgColor=”#ffffff”>
                      <IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″> 美元价
                     </TD>
                     <TD bgColor=”#ffffff”><font
color=”red”><B> 525.00 </B></font>
                     </TD>
                    </tr>
                   </table>
                  </TD>
                 </TR>
                </TABLE>
               </td>
              </tr>
             </table>
            </td>
            <td valign=”top”><table width=”150″ border=”0″
cellspacing=”0″ cellpadding=”0″>
              <tr>
               <td width=”150″ align=”center”><A
href=”../featuredproducts/product_jump.asp?product_id=7200″><img
src=””
border=”0″
onLoad=”javascript:MM_setIMG(this.width,this.height,this)”></A></td>
              </tr>
              <tr>
               <td><TABLE width=”98%” border=”0″ align=”center”
cellpadding=”0″ cellspacing=”0″ bgcolor=”#F2F2F2″
                 style=”BORDER-COLLAPSE: collapse”>
                 <TR>
                  <TD width=”8%” bgColor=”#ffffff”
height=”25″><IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″></TD>
                  <TD bgColor=”#ffffff” height=”25″>
                   <A
href=”../featuredproducts/product_jump.asp?product_id=7200″>Giuseppe
Zanott ….</A></TD>
                 </TR>
                 <TR>
                  <TD width=”8%” bgColor=”#ffffff”
height=”25″><IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″></TD>
                  <TD bgColor=”#ffffff”
height=”25″>小湖羊皮高跟女鞋</FONT></TD>
                 </TR>
                 <TR>
                  <TD align=”middle” colSpan=”2″ height=”12″>
                   <table width=”100%” border=”0″ cellspacing=”0″
cellpadding=”0″>
                    <tr>
                     <TD width=”44%” bgColor=”#ffffff”>
                      <IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″> 美元价
                     </TD>
                     <TD bgColor=”#ffffff”><font
color=”red”><B> 475.00 </B></font>
                     </TD>
                    </tr>
                   </table>
                  </TD>
                 </TR>
                </TABLE>
               </td>
              </tr>
             </table>
            </td>
           
            <td valign=”top”><table width=”150″ border=”0″
cellspacing=”0″ cellpadding=”0″>
              <tr>
               <td width=”150″ align=”center”><A
href=”../featuredproducts/product_jump.asp?product_id=7170″><img
src=””
border=”0″
                  onLoad=”javascript:MM_setIMG(this.width,this.height,this)”></A></td>
              </tr>
              <tr>
               <td><TABLE width=”98%” border=”0″ align=”center”
cellpadding=”0″ cellspacing=”0″ bgcolor=”#F2F2F2″
                 style=”BORDER-COLLAPSE: collapse”>
                 <TR>
                  <TD width=”8%” bgColor=”#ffffff”
height=”25″><IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″></TD>
                  <TD bgColor=”#ffffff” height=”25″>
                   <A
href=”../featuredproducts/product_jump.asp?product_id=7170″>Prada
Python/Cr ….</A></TD>
                 </TR>
                 <TR>
                  <TD width=”8%” bgColor=”#ffffff”
height=”25″><IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″></TD>
                  <TD bgColor=”#ffffff”
height=”25″>Prada蟒纹/鳄鱼纹布鞋</FONT></TD>
                 </TR>
                 <TR>
                  <TD align=”middle” colSpan=”2″ height=”12″>
                   <table width=”100%” border=”0″ cellspacing=”0″
cellpadding=”0″>
                    <tr>
                     <TD width=”44%” bgColor=”#ffffff”>
                      <IMG height=”11″ src=”../publicimg/arrow04.gif”
width=”13″> 美元价
                     </TD>
                     <TD bgColor=”#ffffff”><font
color=”red”><B> 850.00 </B></font>
                     </TD>
                    </tr>
                   </table>
                  </TD>
                 </TR>
                </TABLE>
               </td>
              </tr>
             </table>
            </td>
           </tr>
          </table>
         </td>
         <td id=”demo2z” valign=”top”></td>
        </tr>
       </table>
      </div>
     </td>
    </tr>
   </table>
   <script>
var speedz=30
demo2z.innerHTML=demo1z.innerHTML
function Marqueez(){
if(demo2z.offsetWidth-demoz.scrollLeft<=0)
demoz.scrollLeft-=demo1z.offsetWidth
else{
demoz.scrollLeft++
}
}
var MyMarz=setInterval(Marqueez,speedz)
demoz.onmouseover=function() {clearInterval(MyMarz)}
demoz.onmouseout=function() {MyMarz=setInterval(Marqueez,speedz)}
   </script>

1、index.php3
<?
if($login){
?>
<HTML>
<HEAD>
<TITLE>阿布扎比中学3000届高级中学(12)班同学录</TITLE>

解压 jdbc: tar -zxvf mysql-connector-java-5.1.18.tar.gz

<style type=”text/css”>
A {text-decoration: none; color: #336699; font-family: “宋体”;
font-size: 9pt}
A:hover {text-decoration: underline; color: #FF0000; font-family:
“宋体”; font-size: 9pt}  
body {font-family: “宋体”, “serif”; font-size: 9pt}
td {font-family: “宋体”, “serif”; font-size: 9pt}
input {font-size: 9pt}
p {font-size: 9pt}
br {font-size: 9pt}
tr {font-size: 9pt}
table {font-size: 9pt}
INPUT {    FONT-FAMILY: arial,宋体; FONT-SIZE: 9pt; PADDING-TOP: 3px }
INPUT.text {
    BACKGROUND-COLOR: #f0f0f0; BORDER-BOTTOM: #101010 1px solid;
BORDER-LEFT: #101010 1px solid; BORDER-RIGHT: #101010 1px solid;
BORDER-TOP: #101010 1px solid; COLOR: #000000
}
INPUT.file {
    BACKGROUND-COLOR: #f0f0f0; BORDER-BOTTOM: #101010 1px solid;
BORDER-LEFT: #101010 1px solid; BORDER-RIGHT: #101010 1px solid;
BORDER-TOP: #101010 1px solid; COLOR: #000000
}
SELECT {
    BACKGROUND-COLOR: #f0f0f0; BORDER-BOTTOM: #101010 1px solid;
BORDER-LEFT: #101010 1px solid; BORDER-RIGHT: #101010 1px solid;
BORDER-TOP: #101010 1px solid; COLOR: #000000
}
TEXTAREA {
    BACKGROUND-COLOR: #f0f0f0; BORDER-BOTTOM: #101010 1px solid;
BORDER-LEFT: #101010 1px solid; BORDER-RIGHT: #101010 1px solid;
BORDER-TOP: #101010 1px solid; COLOR: #000000
}
.stedit { font-size: 9pt; border-left: 1px solid #4a3163;  
border-right: 1px solid #4a3163; border-top: 1px solid #4a3163;  
border-bottom: 1px solid #000066 }
.stbtm { background-color: #cococo; color: #000000; font-size: 9pt;
height: 20px;  
border-left: 1px solid #ffffff; border-right: 1px solid #665b8e;  
border-top: 1px solid #ffffff; border-bottom: 1px solid #665b8e }
.ddd {COLOR: #ffffff; FILTER: glow(color=black,strength=1); FONT-SIZE:
9pt; LINE-HEIGHT: 13pt; POSITION: relative; WIDTH: 100%}
</style>

配置 jdbc:cp mysql-connector-java-5.1.18-bin.jar
/usr/local/jdk1.6.0_22/jre/lib/ext/

</HEAD>
<body bgcolor=”#FFFFFF”>
<p class=pt10
align=center><b>蒙特利尔中学两千届高级中学(12)班同学录</b><br>
<table border=”0″ width=”80%” cellpadding=”2″ cellspacing=”1″
bgcolor=”#000000″ align=”center”>
  <tr align=center>  
    <td width=19% bgcolor=”#336699″><font
color=”#FFFFFF”>姓名</FONT></td>
    <td width=17% bgcolor=”#336699″><font
color=”#FFFFFF”>NickName</font></td>
    <td width=18% bgcolor=”#336699″><font
color=”#FFFFFF”>OICQ</FONT></td>
    <td width=27% bgcolor=”#336699″><font
color=”#FFFFFF”>邮件地址</font></td>
    <td width=19% bgcolor=”#336699″><font
color=”#FFFFFF”>详细音讯</font></td>
  </tr>
<?
$dbm=dbmopen(“class”,”r”);
$key = dbmfirstkey($dbm);
while ($key) {
    $data=dbmfetch($dbm, $key);
    $info=explode(“|!:!|”,$data);
    echo “<tr BGCOLOR=\”#FFF5E1\” align=\”center\”><td
width=19%><a
href=show.php3?id=$key>$info[0]</a></td><td
width=17%>$info[1]</td><td
width=18%>$info[4]</td><td
width=27%>$info[2]</td><td width=19%><a
href=\”show.php3?id=$key\”>点击查阅</a></td></tr>”;
    $key = dbmnextkey($dbm, $key);
}
?>
  <tr BGCOLOR=”#336699″ align=”center”>  
    <td colspan=”5″><font color=#FFFFFF><a
href=”modify.php3″><font
color=#FFFFFF>修改材质</font></a>||<a
href=”changepwd.php3″><font
color=#FFFFFF>修改密码</font></a>||<a
href=”logout.php3″><font
color=#FFFFFF>点击退出</font></a></font></td>
  </tr>
</table>
<p align=”center”> Ex同学录v1.0版本程序制作:<a
href=”mailto:y10k@963.net”>y10k</a><br>
  应接访谈:<a href=””
target=”_blank”>; </p>
</body></html>
澳门新葡亰官网app,<?
}else header(“location:login.php3”);
?>

配置JSP:

2、退换密码的changepwd.php3
<?
require(“common.php3”);
if($submit){
$id=$login;
if($id==false)error(“请登入后再修改密码”);
else{
  $data=dbmopen(“password”,”w”);
  $pass=dbmfetch($data,$login);
  if($password==$pass){
    if($password2==$password1){
      dbmreplace($data,$id,$password2);
      header(“location:index.php3”);
    }else error(“您四回输入的密码不一样样啊!”);
  }else error(“对不起,您输入的原来的密码错误,无法改改密码!”);
}
}else{
?>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<HTML><HEAD>
<META content=”text/html; charset=gb2312″
http-equiv=Content-Type><LINK  
href=”style.css” rel=stylesheet>
<META content=”MSHTML 5.00.2614.3500″
name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<FORM action=changepwd.php3 method=post>
<CENTER>
    <TABLE bgColor=#000000 border=0 cellSpacing=1>
      <TBODY>  
      <TR align=middle>  
        <TD align=middle bgColor=#336699 colSpan=4><FONT  
      color=#ffffff>用户修改密码</FONT></TD>
      </TR>
      <TR align=middle>  
        <TD align=middle bgColor=#f7f7f7 width=”122″>  
          <P align=center>老的密码</P>
        </TD>
        <TD align=middle bgColor=#f7f7f7 colspan=”3″
width=”205″>     
          <INPUT  
      class=stedit name=password>
        </TD>
      </TR>
      <tr align=middle>  
        <td align=middle bgcolor=#f7f7f7 width=”122″>  
          <p align=center>新的密码</p>
        </td>
        <td align=middle bgcolor=#f7f7f7 colspan=”3″
width=”205″>     
          <input  
      class=stedit name=password1>
        </td>
      </tr>
      <tr align=middle>  
        <td align=middle bgcolor=#f7f7f7 width=”122″>  
          <p align=center>重复密码</p>
        </td>
        <td align=middle bgcolor=#f7f7f7 colspan=”3″
width=”205″>     
          <input  
      class=stedit name=password2>
        </td>
      </tr>
      <TR align=middle>  
        <TD align=middle bgColor=#f7f7f7 colSpan=4>  
          <DIV align=center>  
            <P>  
              <INPUT class=stbtm name=submit type=submit
value=确认修改>
                   
              <INPUT class=stbtm type=reset value=重新修改
name=”reset”>
            </P>
          </DIV>
        </TD>
      </TR>
      </TBODY>  
    </TABLE>
  </CENTER></FORM></BODY></HTML>
<?
}
?>

JSP示例:

  1. <%@ page language=”java” import=”java.sql.*”%>  
  2. <%@ page language=”java” import=”java.io.*” %>  
  3.   
  4. <html>  
  5. <head>  
  6. <title>Read from mySQL Database</title>  
  7. </head>  
  8.   
  9. <body>  
  10.   
  11. <p align=”center”><b**>Following records are selected from table “gametop800”</b><br>**  
  12.  </p>  
  13.   
  14. <div align=”center” width=”85%”>  
  15. <center>  
  16. <table border=”1″ borderColor=”#ffe9bf” cellPadding=”0″ cellSpacing=”0″  
  17.     width=”658″ height=”63″>  
  18.     <tbody>  
  19.   
  20.         <td bgColor=”#008080″ width=”47″ align=”center” height=”19″>  
  21.             <font color=”#ffffff”><b**>top</b></font></td>**  
  22.         <td bgColor=”#008080″ width=”107″ height=”19″>  
  23.             <font color=”#ffffff”><b**>id</b></font></td>**  
  24.         <td bgColor=”#008080″ width=”224″ height=”19″>  
  25.             <font color=”#ffffff”><b**>name</b></font></td>**  
  26.         <td bgColor=”#008080″ width=”270″ height=”19″>  
  27.             <font color=”#ffffff”><b**>country</b></font></td>**  
  28.         <td bgColor=”#008080″ width=”270″ height=”19″>  
  29.             <font color=”#ffffff”><b**>dtime</b></font></td>**  
  30.   
  31.         <%  
  32.             String DRIVER = “com.mysql.jdbc.Driver”;  
  33.             String url = “jdbc:mysql://localhost:3306/top800”;  
  34.   
  35.             Connection con = null;  
  36.             ResultSet rst = null;  
  37.             Statement stmt = null;  
  38.               
  39.             int i = 1;  
  40.   
  41.             try {  
  42.                 Class.forName(DRIVER).newInstance();  
  43.                   
  44.                 con = DriverManager.getConnection(url, “root”, “”);  
  45.                 stmt = con.createStatement();  
  46.                 rst = stmt.executeQuery(“select top, id, name, country, dtime from gametop800 where top=1”);  
  47.                 while (rst.next()) {  
  48.                     if (i == (i / 2) * 2) {  
  49.         %>  
  50.         <tr>  
  51.             <td bgColor=”#ffff98″ vAlign=”top” width=”47″ align=”center” height=”19″>**<%=rst.getInt(1)%>.</td>**  
  52.             <td bgColor=”#ffff98″ vAlign=”top” width=”107″ height=”19″>**<%=rst.getString(2)%></td>**  
  53.             <td bgColor=”#ffff98″ vAlign=”top” width=”224″ height=”19″><**a href=”<%=rst.getString(3)%>”>**<%=rst.getString(3)%></a></td>  
  54.             <td bgColor=”#ffff98″ vAlign=”top” width=”270″ height=”19″>**<%=rst.getString(4)%></td>**  
  55.             <td bgColor=”#ffff98″ vAlign=”top” width=”270″ height=”19″>**<%=rst.getString(5)%></td>**  
  56.         </tr>  
  57.         <% } else {  
  58.         %>  
  59.         <tr>  
  60.             <td bgColor=”#ffcc68″ vAlign=”top” width=”47″ align=”center” height=”19″>**<%=rst.getInt(1)%>.</td>**  
  61.             <td bgColor=”#ffcc68″ vAlign=”top” width=”107″ height=”19″>**<%=rst.getString(2)%></td>**  
  62.             <td bgColor=”#ffcc68″ vAlign=”top” width=”224″ height=”19″><**a href=”<%=rst.getString(3)%>”>**<%=rst.getString(3)%></a> </td>  
  63.             <td bgColor=”#ffcc68″ vAlign=”top” width=”270″ height=”19″>**<%=rst.getString(4)%></td>**  
  64.             <td bgColor=”#ffff98″ vAlign=”top” width=”270″ height=”19″>**<%=rst.getString(5)%></td>**  
  65.         </tr>  
  66.         <% }  
  67.             i++;  
  68.                 }  
  69.                 rst.close();  
  70.                 stmt.close();  
  71.                 con.close();  
  72.             } catch (Exception e) {  
  73.                 System.out.println(e.getMessage());  
  74.             }  
  75.         %>  
  76.   
  77.     </tbody>  
  78. </table>  
  79. </center>  
  80. </div>  
  81.   
  82. </body>  
  83. </html>  

实行结果:

澳门新葡亰官网app 1

澳门新葡亰官网app 2

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 澳门新葡亰官网app 版权所有