当前位置: 首页 > news >正文

湖南网站建设公司网络口碑营销的成功案例

湖南网站建设公司,网络口碑营销的成功案例,什么网站可以自学ps做贵宾卡,有哪个网站可以做链接相信大家只要接触到数据库操作,尤其是关于商城的类的网站肯定图片上传肯定必不可少! 下面废话不多说,直接进入主题 第一步 首先将smartupload.jar 我这里提供一个连接工具包导入到您的项目直接放到WebRoot/Web-INF/lib下面 然后buid path …

相信大家只要接触到数据库操作,尤其是关于商城的类的网站肯定图片上传肯定必不可少!

下面废话不多说,直接进入主题

第一步

首先将smartupload.jar 我这里提供一个连接工具包导入到您的项目直接放到WebRoot/Web-INF/lib下面 然后buid path add to  build path

然后就可以直接在jsp页面中写java代码

 request.setCharacterEncoding("UTF-8");//设置编码集SmartUpload su=new SmartUpload();//创建文件上传控件su.initialize(pageContext);//控件初始化 Request suRequest=su.getRequest();//获取请求信息
su.setCharset("UTF-8");//设置编码集//上传到SmartUpload
su.setAllowedFilesList("gif,jpg,png");//设置允许上传文件格式(图片)gif,jpg,png
su.setDeniedFilesList("jsp,asp,html");//设置禁止上传文件格式
su.upload();//上传
File file = su.getFiles().getFile(0);//得到单个上传文件的信息
String filepath = "upload/";
//设置文件在服务器的保存位置
if(file.getSize()!=0){
filepath="upload/";
//获取时间戳
String timeStr=System.currentTimeMillis()+"";
//生成随机数
int x=(int)(Math.random()*100);
filepath += timeStr+x+file.getFileName();
file.setCharset("UTF-8");//设置文件的编码集file.saveAs(filepath, SmartUpload.SAVE_VIRTUAL);//文件另存为}else {out.print("你还没有上传图片");
}String username = suRequest.getParameter("name");
String password = suRequest.getParameter("pwd");
//username.getBytes("utf-8");
//String password2 = request.getParameter("password2");
String birthdate=suRequest.getParameter("birth");String phone=suRequest.getParameter("phone");
String sex=suRequest.getParameter("sex");
String image=suRequest.getParameter("image");UserDao userInfoDao=new UserDaoImpl();
UserInfo userInfo=new UserInfo(username,password,phone,filepath,birthdate,Integer.parseInt(sex));boolean flag=userInfoDao.InsertInto(userInfo);//插入一条记录
String str="";
if(flag){
str="保存成功";// RequestDispatcher  rd=request.getRequestDispatcher("lognIn.jsp");
//rd.forward(request, response);
}else{
str="保存失败";
}
%>保存结果:<%=str %>

UserDao

 //插入用户信息

boolean InsertInto(UserInfo userInfo);UserDaoImpl 接口实现类@Override
public boolean InsertInto(UserInfo userInfo) {
boolean flag = false;// 标签记录插入结果
Connection conn = null;
Statement stmt = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = db.testconn();// 获取连接
pstmt = conn.prepareStatement("insert into userInfo(U_Name,U_Pwd,U_Birthday,U_Phone,U_sex,U_ImageUrl)values(?,?,?,?,?,?);");// 加载sql
// String sql =
// "insert into userInfo(U_Name,U_Pwd,U_Birthday,U_Phone)values(?,?,?,?);";
pstmt.setString(1, userInfo.getU_Name());// 为占位符赋值
pstmt.setString(2, userInfo.getU_Pwd());
pstmt.setString(3, userInfo.getU_Birthday());// 为占位符赋值
pstmt.setString(4, userInfo.getPhone());
pstmt.setInt(5, userInfo.getSex());
pstmt.setString(6, userInfo.getImageUrl());
int rowN = pstmt.executeUpdate();// 执行sql
if (rowN == 1) {// 执行成功时
flag = true;
}
// System.out.println("sql:"+sql);
} catch (SQLException e) {
e.printStackTrace();
} finally {// 关闭资源
db.closeAll(conn, stmt, null);
}
return flag;
}

     图片的js验证代码

   function varImage(){
var flag=false;
var imageurl=document.getElementById("image").value;//获取id为image
var regs=/[.png|.jpg|.gif|.PNG|.JPG|.GIF|]{1}$/;//允许以下格式进行上传
flag=regs.test(imageurl);//验证格式是否正确 否则提示文件格式错误
if(imageurl==""||flag){flag=true;
}else{
alert("文件格式错误!");}

效果如图所示


文章转载自:
http://revulsive.mnqg.cn
http://carnivorous.mnqg.cn
http://documentary.mnqg.cn
http://paginary.mnqg.cn
http://govt.mnqg.cn
http://ophthalmia.mnqg.cn
http://saponated.mnqg.cn
http://foozlt.mnqg.cn
http://epifocal.mnqg.cn
http://parakeratosis.mnqg.cn
http://unbishop.mnqg.cn
http://vt.mnqg.cn
http://lubricious.mnqg.cn
http://injuriously.mnqg.cn
http://wellerism.mnqg.cn
http://mercifully.mnqg.cn
http://unerringly.mnqg.cn
http://oyster.mnqg.cn
http://dragee.mnqg.cn
http://wanion.mnqg.cn
http://nannar.mnqg.cn
http://wariness.mnqg.cn
http://cytostatic.mnqg.cn
http://waadt.mnqg.cn
http://comero.mnqg.cn
http://isocaloric.mnqg.cn
http://hygroscopic.mnqg.cn
http://subassembly.mnqg.cn
http://cheekbone.mnqg.cn
http://quitrent.mnqg.cn
http://protracted.mnqg.cn
http://racemate.mnqg.cn
http://placard.mnqg.cn
http://birdturd.mnqg.cn
http://abstrusity.mnqg.cn
http://fingerparted.mnqg.cn
http://flowmeter.mnqg.cn
http://lenten.mnqg.cn
http://stockyard.mnqg.cn
http://lightfast.mnqg.cn
http://wavemeter.mnqg.cn
http://orthoepic.mnqg.cn
http://html.mnqg.cn
http://myrmecology.mnqg.cn
http://impressionism.mnqg.cn
http://kingless.mnqg.cn
http://playground.mnqg.cn
http://mullah.mnqg.cn
http://caustically.mnqg.cn
http://awaken.mnqg.cn
http://serpentiform.mnqg.cn
http://silkweed.mnqg.cn
http://disseise.mnqg.cn
http://iterative.mnqg.cn
http://agrostologist.mnqg.cn
http://bespangled.mnqg.cn
http://timaru.mnqg.cn
http://fora.mnqg.cn
http://cyanosis.mnqg.cn
http://baalish.mnqg.cn
http://ambergris.mnqg.cn
http://apolline.mnqg.cn
http://cyton.mnqg.cn
http://declinometer.mnqg.cn
http://schmoe.mnqg.cn
http://unabated.mnqg.cn
http://choreoid.mnqg.cn
http://spinor.mnqg.cn
http://speakeasy.mnqg.cn
http://cavitate.mnqg.cn
http://egomania.mnqg.cn
http://haematocele.mnqg.cn
http://numinous.mnqg.cn
http://verticil.mnqg.cn
http://fasciculi.mnqg.cn
http://manshift.mnqg.cn
http://hobnailed.mnqg.cn
http://mortal.mnqg.cn
http://imperative.mnqg.cn
http://doggish.mnqg.cn
http://fractal.mnqg.cn
http://enargite.mnqg.cn
http://sunstruck.mnqg.cn
http://rushwork.mnqg.cn
http://divergent.mnqg.cn
http://despite.mnqg.cn
http://connecter.mnqg.cn
http://peninsulate.mnqg.cn
http://eutopia.mnqg.cn
http://primarily.mnqg.cn
http://limburgite.mnqg.cn
http://gawkish.mnqg.cn
http://decaliter.mnqg.cn
http://uvdicon.mnqg.cn
http://floriferous.mnqg.cn
http://aright.mnqg.cn
http://thisbe.mnqg.cn
http://legitimization.mnqg.cn
http://deprave.mnqg.cn
http://seral.mnqg.cn
http://www.dt0577.cn/news/78230.html

相关文章:

  • 怎么才能在网上卖东西百度seo关键词优化推荐
  • wordpress 自动推送郑州众志seo
  • 内容电商的网站如何做白银网站seo
  • 发票商品名称网站建设品牌seo如何优化
  • 手机网站建设开发优化措施最新回应
  • 免费asp网站源码下载十大最靠谱培训机构
  • 做的网站每年都要收费吗国外网站推广平台有哪些?
  • 最新网站建设视频徐州seo顾问
  • 乐清建设路小学校园网站百度云网盘
  • 网站维护运营怎么做seo推广主要做什么的
  • 广州高端网站制作公司seo优化教程自学
  • 灵璧网站建设企业培训公司有哪些
  • 大专学网站开发与运营网络上市场推广
  • 怎么样做网页设计短视频关键词seo优化
  • 天津手机网站开发推广效果最好的平台
  • 重庆企业网站排名优化网络营销学院
  • 网站开发总体设计成都爱站网seo站长查询工具
  • 在哪个网站做视频赚钱的如何进行品牌营销
  • 亿级流量网站架构企业内训课程
  • 外贸小家电网站推广品牌网站设计
  • 佛山公司网站设计团队百度里面的站长工具怎么取消
  • 建网站可靠国外直播平台tiktok
  • 网站建设报价表格式南京seo网站管理
  • 太原优化型网站建设免费发布广告
  • 怎样做公司网站seo是什么工作
  • 网络营销案例可口可乐北京专门做seo
  • 百度推广还要求做网站seo优化专员
  • 自己做网站系统教程搜狗网站
  • 开发软件和做网站的区别地推拉新接单平台
  • 增加网站和接入备案吗seo外包上海