简单的头像上传
一:jsp代码
[html]
<form action="/FastFood/userInfo.do?p=addUser" method="post" name="myForm" enctype="multipart/form-data">
<table class="table" cellspacing="1" cellpadding="2" width="99%" align="center" border="0">
<tbody>
<tr>
<td class="bg_tr" height="21" colspan="2"></td>
</tr>
<tr>
<td class="td_bg" height="30" colspan="2" align="center"><b style="font-size: 16px;">新增会员信息</b></td>
</tr>
<tr>
<td colspan="2" class="td_bg">注意事项:下列带*字符为必填内容,且慎重填写。</td>
</tr>
</tbody>
</table>
<table class="table" cellspacing="1" cellpadding="2" width="99%" align="center" border="0">
<tbody>
<tr>
<th class="bg_tr" align="right" colspan="2" height="25">
<input type="button" value="" onclick="javascript:history.go(-1);" style="cursor:pointer;border:0px;width:54px;height:22px;background-image:url(admin/images/fh.jpg);">
</th>
</tr>
<tr>
<td class="td_bg" width="45%" height="26" align="right">账户名称:<font color="red">*</font></td>
<td class="td_bg" width="55%">
<div style="float:left;"><input id="userName" name="userName" onblur="yzName2()" style="width:180px;"></div>
<div id="yzUserName" style="float:left;margin-left:6px;margin-top:3px;"></div>
</td>
</tr>
<tr>
<td class="td_bg" width="45%" height="26" align="right">账户密码:<font color="red">*</font></td>
<td class="td_bg" width="55%">
<div style="float:left;"><input type="password" id="pwd" name="pwd" onblur="yzPwd()" style="width:180px;"></div>
<div id="yzPwd" style="float:left;margin-left:6px;margin-top:3px;"></div>
</td>
</tr>
<tr>
<td class="td_bg" width="45%" height="26" align="right">确认密码:<font color="red">*</font></td>
<td class="td_bg" width="55%">
<div style="float:left;"><input type="password" id="Rpwd" onblur="yzRPwd()" style="width:180px;"></div>
<div id="yzRpwd" style="float:left;margin-left:6px;margin-top:3px;"></div>
</td>
</tr>
<tr>
<td class="td_bg" width="45%" height="26" align="right">性 别:<font color="red">*</font></td>
<td class="td_bg" width="55%">
<input type="radio" id="易做图" name="易做图" value="1" checked>男
<input type="radio" id="易做图" name="易做图" value="2">女
</td>
</tr>
<tr>
<td class="td_bg" width="45%" height="26" align="right">用户头像: </td>
<td class="td_bg" width="55%"><input type="file" name="photos" style="width:252px;"></td>
</tr>
<tr>
<td class="td_bg" width="45%" height="26" align="right">联系电话: </td>
<td class="td_bg" width="55%"><input name="telephone" onkeypress="return regInput(this,/^[0-9-]*$/,String.fromCharCode(event.keyCode))" style="wid
补充:web前端 , HTML/CSS ,