|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi
hi
|
|
#2
|
|||
|
|||
|
'ello
'ello
__________________
-james |
|
#3
|
|||
|
|||
|
cookies
Hi
At present i developing one small forumsn website my self. So how i store username and password when i open my website next time.I mean i create username and password and i put option as "checkbox" like this 'remember me'.so i can select check option when i enter next time this page it will automatically enter forumn page directly. So which concept i can use for storing username and password. Same like in this forumn website . i using servlets and oracle.. so any advice ??? i attaching html file .hope every body can unerstood ... |
|
#4
|
|||
|
|||
|
///this is the html file
<html> <head><title>RegistrationForm</title></head> <body> <center><h2><b>RegistrationForm</b></h2></center> <center> MemberName :<input type=text><br> Password :<input type=password><br> ConfirmPassowrd :<input type=password><br> First Name :<input type=text><br> Last Name :<input type=text><br> Current mail :<input type=text><br> occupation :<input type=text><br> DateOfBirth :<SELECT id=birthmonth name=birthmonth> <OPTION selected value=""></OPTION> <OPTION value=1>1</OPTION> <OPTION value=2>2</OPTION> <OPTION value=3>3</OPTION> <OPTION value=4>4</OPTION> <OPTION value=5>5</OPTION> <OPTION value=6>6</OPTION> <OPTION value=7>7</OPTION> <OPTION value=8>8</OPTION> <OPTION value=9>9</OPTION> <OPTION value=10>10</OPTION> <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION></SELECT> m <SELECT id=birthday name=birthday> <OPTION selected value=""></OPTION> <OPTION value=1>1</OPTION> <OPTION value=2>2</OPTION> <OPTION value=3>3</OPTION> <OPTION value=4>4</OPTION> <OPTION value=5>5</OPTION> <OPTION value=6>6</OPTION> <OPTION value=7>7</OPTION> <OPTION value=8>8</OPTION> <OPTION value=9>9</OPTION> <OPTION value=10>10</OPTION> <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION> <OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION> <OPTION value=15>15</OPTION> <OPTION value=16>16</OPTION> <OPTION value=17>17</OPTION> <OPTION value=18>18</OPTION> <OPTION value=19>19</OPTION> <OPTION value=20>20</OPTION> <OPTION value=21>21</OPTION> <OPTION value=22>22</OPTION> <OPTION value=23>23</OPTION> <OPTION value=24>24</OPTION> <OPTION value=25>25</OPTION> <OPTION value=26>26</OPTION> <OPTION value=27>27</OPTION> <OPTION value=28>28</OPTION> <OPTION value=29>29</OPTION> <OPTION value=30>30</OPTION> <OPTION value=31>31</OPTION></SELECT> d <INPUT maxLength=4 name=birthyear size=4>yyyy <br> Gender :<INPUT id=gender name=gender type=radio value=m>Male <INPUT id=gender name=gender type=radio value=f>Female<br> Location :<input type=text><br> Homepage :<input type=text><br><br> <INPUT name=rememberme type=checkbox value=1> Please remember my member name and password for future logins. <br><br> <input type= submit> </center> </body> </html> |
|
#5
|
|||
|
|||
|
Well, from a jsp page, you might do something like:
Code:
<%@page import="javax.servlet.http.Cookie"%> <% usernameCookie = new Cookie( "username", request.getParameter( "username_from_form" ) ); response.addCookie( usernameCookie ); %> Then, on your other pages, you can check for the username cookie. Code:
<%@page import="javax.servlet.http.Cookie"%>
<%
String username = null;
Cookie[] cookies = request.getCookies();
if ( cookies != null ) {
for ( int i = 0; i < cookies.length; i++ ) {
if ( cookies[i].getName().equals( "username" ) ) {
username = cookies[i].getValue();
}
}
}
%>
|
|
#6
|
|||
|
|||
|
thanks
Thanks for your good comment and suggestion.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > hi |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|