JSP Data Update code
<script language= "JavaScript" >
function Form1_onsubmit ()
{
if (document.form1.sitename.value== "")
{
Window.alert ("Please enter site name");
return false;
}
}
Modify the height of the edit bar
function Textarea_size (num,objname)
{
var Obj=document.getelementbyid (objname)
if (parseint (obj.rows) +num>=3) {
Obj.rows = parseint (obj.rows) + num;
}
if (num>0)
{
Obj.width= "90%";
}
}
</script>
<%
String aforder= (String) session.getattribute ("Aforder");
%>
<body>
<br/>
<a href= "siteconfig_info.jsp" > Site information </a><% if ( Aforder.equals ("1")) {%> | <a href= ' siteconfig_update.jsp ' > Information modification </a><%}%>
<%
if (Request.getparameter ("SiteName")!= null)
{
String sitename=new string (Request.getparameter (" SiteName "). GetBytes (" iso-8859-1 "));
String Siteurl=new string (Request.getparameter ("SiteURL"). GetBytes ("iso-8859-1"));
String Sitetitle=new string (Request.getparameter ("Sitetitle"). GetBytes ("iso-8859-1"));
String Ftel=new string (Request.getparameter ("Ftel"). GetBytes ("iso-8859-1"));
String Ffax=new string (Request.getparameter ("Ffax"). GetBytes ("iso-8859-1"));
String Address=new string (Request.getparameter ("Address"). GetBytes ("iso-8859-1"));
String Fcode=new string (Request.getparameter ("FCode"). GetBytes ("iso-8859-1"));
String Email=new string (request.getparameter ("email"). GetBytes ("iso-8859-1"));
String Metakeywords=new string (Request.getparameter ("Metakeywords"). GetBytes ("iso-8859-1"));
String Metadescription=new string (Request.getparameter ("Metadescription"). GetBytes ("iso-8859-1"));
Statement stmt_configupdate=conn.createstatement ();
String sql_u= "Update hl_siteconfig set fsitename= ' +sitename+" ', Fsiteurl= ' "+siteurl+" ', fsitetitle= ' "+sitetitle+" ', Ftel= ' "+ftel+" ', ffax= ' "+ffax+" ', address= ' "+address+" ', email= ' "+email+" ', fcode= ' "+fcode+" ', fmetakeywords= ' "+ Metakeywords+ "', fmetadescription= '" +metadescription+ "" where id=1 ";
int gai=stmt_configupdate.executeupdate (SQL_U);
Stmt_configupdate.close ();
if (gai>0)
{
Out.print ("<p align= ' center ' >[" + SiteName + "] Site Configuration modification Success </p>");
}
}
Statement stmt_siteconfig=conn.createstatement ();
String sql= "Select * from Hl_siteconfig";
ResultSet rssiteconfig=stmt_siteconfig.executequery (SQL);
Rssiteconfig.next ();
%>
<form id= "Form1" Name= "Form1" method= "Post" action= "" onsubmit= "return Form1_onsubmit ()" >
<table width= "border=" "0" align= "center" >
<tr>
<TD width= "align=" "right" > website name:</td>
<td><input name= "SiteName" type= "text" value= "<%=rssiteconfig.getstring (" Fsitename ")%>" size= "" 40 "/ ></td>
</tr>
<tr>
<TD align= "right" > website URL:</td>
<td><input name= "SiteURL" type= "text" value= "<%=rssiteconfig.getstring (" Fsiteurl ")%>" size= "" 30 "/ >
* input http://</td>
</tr>
<tr>
<TD align= "Right" > Company name:</td>
<td><input name= "Sitetitle" type= "text" value= "<%=rssiteconfig.getstring (" Fsitetitle ")%>" size= "40 /></td>
</tr>
<tr>
<TD align= "Right" > Company Tel:</td>
<td><input name= "Ftel" type= "text" value= "<%=rssiteconfig.getstring (" Ftel ")%>" size= "/></ Td>
</tr>
<tr>
<TD align= "Right" > Company Fax:</td>
<td><input name= "Ffax" type= "text" value= "<%=rssiteconfig.getstring (" Ffax ")%>" size= "/></ Td>
</tr>
<tr>
<TD align= "Right" > Company email:</td>
<td><input name= "Email" type= "text" value= "<%=rssiteconfig.getstring (" email ")%>" size= "/>< /TD>
</tr>
<tr>
<TD align= "Right" > Company address:</td>
<td><input name= "Address" type= "text" value= "<%=rssiteconfig.getstring (" Address ")%>" size= "/> </td>
</tr>
<tr>
<TD align= "Right" > Zip:</td>
<td><input name= "FCode" type= "text" value= "<%=rssiteconfig.getstring (" FCode ")%>" size= "/>< /TD>
</tr>
<tr>
<TD align= "right" > site keyword:</td>
<td><textarea name= "Metakeywords" cols= "6" rows= "id=" Metakeywords (" Fmetakeywords ")%></textarea>
<a href= "Javascript:textarea_size ( -5, ' metakeywords ')" title= "reduce edit area" >
<font face= "Wingdings" size= "3" color= "#0000FF" >& #241;</font></a>
<a href= "Javascript:textarea_size (5, ' metakeywords ')" title= "Increased editing area" >
<font face= "Wingdings" size= "3" color= "#0000FF" >& #242;</font></a>
</td>
</tr>
<tr>
<TD align= "Right" > site description:</td>
<td>
<textarea name= "Metadescription" cols= "6" rows= "id=" Metadescription (" Fmetadescription ")%></textarea>
<a href= "Javascript:textarea_size ( -5, ' metadescription ')" title= "reduce edit area" >
<font face= "Wingdings" size= "3" color= "#0000FF" >& #241;</font></a>
<a href= "Javascript:textarea_size (5, ' metadescription ')" title= "Increased editing area" >
<font face= "Wingdings" size= "3" color= "#0000FF" >& #242;</font></a>
</td>
</tr>
<tr>
<td></td>
<td><input type= "Submit" name= "Submit" value= "Modify"/>
<input type= "reset" name= "reset" value= "reset"/></TD>
& nbsp </tr>
</table>
</form>
<p> </p>
</body>
< /html>
<%
Rssiteconfig.close ();
Stmt_siteconfig.close ();
Conn.close ();
%>