日期:2014-05-18  浏览次数:20608 次

一个同时把上传图片和其他字段同时写入数据库的问题!
add.html
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
<link   href= "../hyzx/inc/stlye.css "   rel= "stylesheet "   type= "text/css "   />
</head>

<body>
<form   action= "add.jsp "   method= "post "   enctype= "multipart/form-data "   name= "form1 "   id= "form1 ">
    <table   width= "764 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   bgcolor= "#81A4D3 ">
        <tr>
            <td   height= "23 "   colspan= "2 "   align= "center "   background= "../images/tabbg.gif "> <strong> 发布企业信息 </strong> </td>
        </tr>
    </table>
    <table   width= "760 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "1 "   bgcolor= "#81A4D3 ">
        <tr>
            <td   width= "91 "   height= "30 "   bgcolor= "#FFFFFF "> 选择公司形象: </td>
            <td   width= "669 "   height= "30 "   bgcolor= "#FFFFFF "> &nbsp;
                <label>
                <input   type= "file "   name= "file "   style= "height:18px;width:160px;border-color:   #81A4D3;   border-style:   solid;   border-width:   1px   1px   1px   1px "   />
            </label> </td>
        </tr>
<tr>
            <td   width= "91 "   height= "30 "   bgcolor= "#FFFFFF "> &nbsp;公司名称 </td>
            <td   width= "669 "   height= "30 "   bgcolor= "#FFFFFF "> &nbsp; <input   name= "company "   type= "text "   style= "height:18px;width:160px;border-color:   #81A4D3;   border-style:   solid;   border-width:   1px   1px   1px   1px "   id= "company "   /> </td>
        </tr>
                <tr>
            <td   colspan= "2 "   bgcolor= "#FFFFFF "> <table   width= "760 "   border= "0 "   align= "center "   cellpadding= "2 "   cellspacing= "0 ">