<%-- 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"); String format = ""; String language=""; Config c = new Config(); Connection con = c.getcon(); Statement st = con.createStatement(); String qry = "SELECT * FROM "+res+"solutions WHERE problemcode='"+pcode+"'"; ResultSet rs = st.executeQuery(qry); while(rs.next()) { language = rs.getString("language"); out.println("

"+ language + ":

"); format = "
 ";
                       out.println(format+rs.getString("sourcecode")+"
"); out.println("

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


"); } %>




<% qry = "SELECT * FROM commentsource 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" %>