个人信息界面
代码:
logined.html
个人信息完善
<input type="file" id="file" src="../images/test2.jpg" style="height: 50px;width: 70px;"onchange="changepic(this)"/>
<br />
<img src="../images/1.jpg" id="img3" style="height: 50px;width: 50px;"/>
<br />
昵称 :<input type="text" /><br />
年龄 :<input type="text" /><br />
<tr>
<!--name必须相同-->
<td>性别:<input type="radio" name="sex"/>男 </td>
<td></td><input type="radio" name="sex"/>女</td>
</tr>
<br />
学校 :<input type="text" /><br />
邮箱 :<input type="text"/><br />
<button type="button">提交</button>
</div>
<script type="text/javascript" src="info.js"></script>
</body>
info.js
function changepic() {
var reads = new FileReader();
//files[0]一次性上传一张图片
f = document.getElementById('file').files[0];
reads.readAsDataURL(f);
reads.onload = function(e) {
document.getElementById('img3').src = this.result;
};
}
具体功能:上传头像,保存信息到数据库,关联到每一个账号