小白求大神将jsp代码改为php代码

qq_18048683 2016-06-03 07:33:52
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>


<html>
<head>


<title>books</title>

<style type="text/css">
body{
background-image:url(images/beijing1.gif);}
.zitiyuan{color:grey;}
.zitixian{color:#F30;}
</style>

<link rel="stylesheet" type="text/css" href="CSS/link.css">
<style type="text/css">
table td{width="200" height="150"}
</style>
</head>

<body>

<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/erhuo_db"
user="root" password="chittywu"/>

<sql:query dataSource="${snapshot}" var="result">

SELECT * from books_db;
</sql:query>

<table>
<tr>
<td>
<c:forEach var="book" items="${result.rows}">
<table>
<tr>
<td width="200" height="150"><a href="books1.jsp"><img src="${book.image}"></img></a></td>
</tr>
<tr>
<td width="200" height="25"><a href="books1.jsp">${book.goodsname} </a></td>
</tr>
<tr>
<td width="200" height="25">二手价:<div class="zitixian">${book.price}元</div></td>
</tr>
<tr>
<td width="200" height="25">
原价:<div class="zitiyuan">${book.reprice}元</div></td>
</tr>
</table>
<td>
</c:forEach>
</td>

</table>


</body>
</html>
...全文
199 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧