<%-- Document : register Created on : Dec 9, 2013, 12:49:49 PM Author : aqfaridi --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@page import="java.sql.*,connection.Config" %> CodeShare <% String User =(String) session.getAttribute("username"); // out.print(User); if(User != null) {%> <%@include file="header1.jsp" %> <% } else {%> <%@ include file="header.jsp" %> <% } %>
<% String pcode = request.getParameter("id"); String res = request.getParameter("res"); Config c = new Config(); Connection con = c.getcon(); Statement st = con.createStatement(); String qry = "SELECT * FROM "+res+" WHERE problemcode='"+pcode+"'"; ResultSet rs = st.executeQuery(qry); if(rs.next()) { out.println("

"); out.println("Problem Name: "+rs.getString("problemname")+"
"); out.println("Problem Code: " + rs.getString("problemcode")); out.println("


"); out.println(rs.getString("problemdescription")+"
"); %>
<% out.println("

Uploaded By : "+rs.getString("author")+" "+rs.getString("time")+"


"); } %> View Source



<% qry = "SELECT * FROM commentproblem WHERE problemcode='"+pcode+"' ORDER BY Sno DESC"; rs = st.executeQuery(qry); while(rs.next()) { %>

profile <%=rs.getString("username")%> <%=rs.getString("time")%>

<%=rs.getString("comment")%>


<%} if(User!=null) { %>

Leave a Comment


<%} con.close(); %>



<%@include file="footer.jsp" %>