<%@pagecontentType="text/html;charset=gb2312"%><%StringipAddr=null;Cookiecookies[]=request.getCookies();if(cookies!=null){for(inti=0;i<cookies.length;i++){if(cookies[i].getName().equals("ipAddr")){ipAddr=cookies[i].getValue();out.print("<scriptlanguage=\"JavaScript\">alert(\"歡迎您再次訪問本網頁,上次登入IP地址為"+ipAddr+"\");</script>");}}}CookieipAddrCookie=newCookie("ipAddr",""+request.getRemoteAddr());ipAddrCookie.setMaxAge(60*10);//設定Cookie有效期10分鐘response.addCookie(ipAddrCookie);out.print("<scriptlanguage=\"JavaScript\">alert(\"歡迎您首次訪問本網頁,您的IP地址為"+request.getRemoteAddr()+"\");</script>");%>
<%@pagecontentType="text/html;charset=gb2312"%><%StringipAddr=null;Cookiecookies[]=request.getCookies();if(cookies!=null){for(inti=0;i<cookies.length;i++){if(cookies[i].getName().equals("ipAddr")){ipAddr=cookies[i].getValue();out.print("<scriptlanguage=\"JavaScript\">alert(\"歡迎您再次訪問本網頁,上次登入IP地址為"+ipAddr+"\");</script>");}}}CookieipAddrCookie=newCookie("ipAddr",""+request.getRemoteAddr());ipAddrCookie.setMaxAge(60*10);//設定Cookie有效期10分鐘response.addCookie(ipAddrCookie);out.print("<scriptlanguage=\"JavaScript\">alert(\"歡迎您首次訪問本網頁,您的IP地址為"+request.getRemoteAddr()+"\");</script>");%>