473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Session varaiables

For the following code when ever i open the this page the text box has /
i ahve set the value of text box with session variables whic is exuted only when submit button is clicked....Pls Help me....

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>REGISTRATION</title>
  6. <script language="javascript" src="validate.js" type="text/javascript"></script>
  7. </head>
  8. <body>
  9. <h4><b>WELCOME TO REGISTRATION PAGE</b></h4>
  10. <form id="registration" name="registration" method="post"  onsubmit="return ValidateForm();">
  11.  <table width="346">
  12.  
  13.  <tr><br />
  14.   <td width="338" align="Center"><h2 align="center">REGISTRATION</h2></td>
  15.  </tr> 
  16.   <tr>
  17.      <td width="338" align="center" nowrap="nowrap"><h4 align="left">User Name:
  18.           <input name="txtuname" type="text" value=<%=session("username")%> /> <h4 align="left">First Name:
  19.                     <input name="txtfname" type="text" value=<%=session("fname")%> />
  20.      </h4></td>
  21.  </tr>
  22.  
  23.   <tr>
  24.      <td width="338" align="center"><h4 align="left">Last Name:   
  25.           <input name="txtlname" type="text" value=<%=session("lname")%> />     
  26.      </h4></td>
  27.  </tr>
  28.  
  29.  <tr>
  30.      <td align="center" ><h4 align="left">Password:     
  31.           <input name="txtpassword" type="password" value=<%=session("password")%> />     
  32.      </h4></td>
  33.  </tr>
  34.  
  35.   <tr>
  36.      <td align="center"><h4 align="left">EMAIL ID:    
  37.           <input name="txtemail"  type="text" value=<%=session("mail")%> />     
  38.      </h4></td>
  39.  </tr>
  40.  
  41.   <tr>
  42.      <td align="center"><h4 align="left">Phone No:    
  43.           <input name="txtphno" type="text" value=<%=session("phno")%> />     
  44.      </h4></td>
  45.  </tr>
  46.  
  47.    <tr>
  48.      <td align="center"><h4 align="left">Mobile No:    
  49.           <input name="txtmno" type="text" value=<%=session("mno")%> />     
  50.      </h4></td>
  51.  </tr>
  52.  
  53.   <tr>
  54.      <td align="center"><h4 align="left">Address:                       
  55.        <textarea name="txtadd1" wrap="physical" value=<%=session("add1")%>></textarea>
  56.      </h4></td>
  57.  </tr>
  58.  <% response.Write(session("mail"))%>
  59.  <tr>
  60.      <td align="center"><h4 align="left">Address2:    
  61.           <textarea name="txtadd2" value=<%=session("add2")%>></textarea>     
  62.      </h4></td>
  63.  </tr>
  64.  
  65.  <tr>
  66.      <td align="center"><h4 align="left">City:    
  67.           <input name="txtcity" type="text" value=<%=session("city")%>/>     
  68.      </h4></td>
  69.  </tr><tr>
  70.      <td align="center"><h4 align="left">State:    
  71.           <input name="txtstate" type="text" value=<%=session("state")%> />     
  72.      </h4></td>
  73.  </tr>
  74.  
  75.  <tr>
  76.      <td align="center"><h4 align="left">Country:    
  77.           <input name="txtcountry" type="text" value=<%=session("country")%> />     
  78.      </h4></td>
  79.  </tr>
  80.  
  81.  <tr>
  82.      <td align="center"><h4 align="left">Zip code:    
  83.           <input name="txtzip" type="text" value="<%=session("zip")%>" />     
  84.      </h4></td>
  85.  </tr>
  86.  
  87.  <tr><br />
  88.      <td align="center"><input name="btnsubmit" type="submit" id="btnsubmit" value="Submit" />
  89.       <input type="reset" />     </td>
  90.  </tr>     
  91. </table>
  92. </form>
  93.  
  94.  
  95.  
  96. </body>
  97. </html>
  98. <%
  99.  
  100. if(request.form("btnsubmit")<>"") then
  101. mail=request.form("txtemail")
  102. id=request.form("txtuname")
  103.  
  104. set conn=server.CreateObject("ADODB.connection")
  105. conn.Mode = 3
  106. ConnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=Rajesh;Port=3306;DATABASE=agstc2008;UID=root;PWD=sa;character set=utf8;"
  107. conn.open ConnString
  108. set rs=server.CreateObject("ADODB.recordset")
  109. query="select * from tbluser"
  110. Set rs = conn.execute(query)
  111. no=2      
  112.  
  113. while not RS.EOF
  114.  
  115. if rs("userEmailId")=mail OR rs("userId")=id THEN
  116.     Response.Write("EMAIL ID/USER ID ALREADY EXISTS")
  117.      session("username")=request.form("txtuname")
  118.     session("password")=request.form("txtpassword")
  119.     session("fname")=request.form("txtfname")
  120.     session("lname")=request.form("txtlname")
  121.     session("email")=request.form("txtemail")
  122.     session("phno")=request.form("txtphno")
  123.     session("mno")=request.form("txtmno")
  124.     session("add1")=request.form("txtadd1")
  125.     session("add2")=request.form("txtadd2")
  126.     session("city")=request.form("txtcity")
  127.     session("state")=request.form("txtstate")
  128.     session("country")=request.form("txtcountry")
  129.     session("zip")=request.form("txtzip")
  130.     no=1
  131.     end if
  132. rs.movenext
  133. wend
  134. if(no=2) then
  135.     session("username")=request.form("txtuname")
  136.     session("password")=request.form("txtpassword")
  137.     session("fname")=request.form("txtfname")
  138.     session("lname")=request.form("txtlname")
  139.     session("email")=request.form("txtemail")
  140.     session("phno")=request.form("txtphno")
  141.     session("mno")=request.form("txtmno")
  142.     session("add1")=request.form("txtadd1")
  143.     session("add2")=request.form("txtadd2")
  144.     session("city")=request.form("txtcity")
  145.     session("state")=request.form("txtstate")
  146.     session("country")=request.form("txtcountry")
  147.     session("zip")=request.form("txtzip")
  148.     response.Redirect("lsucess.asp")
  149. end if
  150.  
  151. rs.close
  152. conn.close
  153. end if
  154. %>
Nov 6 '08 #1
7 2011
DrBunchman
979 Expert 512MB
Hi gowthamkg,

Which text box has the problem?

Dr B
Nov 6 '08 #2
Hi gowthamkg,

Which text box has the problem?

Dr B
Every text box shows "/" whene ever i load this page...and password text box it is "."
Nov 6 '08 #3
DrBunchman
979 Expert 512MB
Could you try putting some single quotes around the value property of your inputs, like this:

Expand|Select|Wrap|Line Numbers
  1. <input name="txtfname" type="text" value='<%=session("fname")%>' /> 
I wonder if perhaps the interpreter is picking up the closing / of the input tag as part of the value. Probably not the problem but worth giving it a try!

Let me know how what happens,

Dr B
Nov 6 '08 #4
ITS gone..but another problem is that..once i click the submit it should check the database whether email id is present or not if so it should display EMAIL ID/USER ID ALREADY EXISTS and it should keep the same entered data's in the form...pls help me...
Nov 6 '08 #5
DrBunchman
979 Expert 512MB
Is it displaying that text?

I think the problem here might be the condition where you say If (no=2) Then...

As far as I can see you have set the variable no to equal 2 no matter what happens.

Dr B
Nov 6 '08 #6
ya i have set the no =2 default...because if there is only mail id is present it will change to 1 or else it will be directed to a page where it is inserted..
Nov 6 '08 #7
DrBunchman
979 Expert 512MB
Okay, I see what you are doing.

So does that text never display even when there is a mail id present?

Dr B
Nov 6 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
1
by: Danny Ni | last post by:
Hi, Are there limits ( as in the size of each variable, number of varaiables, over all size) to session variables? TIA
2
by: M. Simioni | last post by:
Hi, the webserver is a HP ProLiant DL380 G3 1GB RAM Dual U320 SCSI COMPAQ Smart Array 5i + Battery Pack installed N°2 (RAID 1) COMPAQ BD072863B2 - 72.8GB Ultra320, 10K Hot-pluggable, 1"...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
14
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and...
7
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I...
1
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking...
6
by: somaskarthic | last post by:
Hi This is somas here. I asked query about detecting the browser close event using javascript. I want to detect the event only when the X button in the top right corner is clicked and not else...
5
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.