473,387 Members | 1,545 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,387 software developers and data experts.

URGENT session problem

102 100+
hi...
assume that in pageA i have a dropdown box.., so when i click the value in the dropdown box.. and the value will come out in the textbox below..

<input type="textbox" name= "date1" value=<%rsGet.field("date")%> >

so if i want to update that date in the textbox.. the update query is in page B

if the value is correct then .. fine.. can update...

but if let say value is wrong..
page B
[PHP]session("date") = request.form ( " date1" )
if session(" date ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]

HOW DO I MAINTAIN THE DATA FOR KAKAKA WHICH USER JUST KEY IN TO PAGE A...


it is because in pageA... that textbox data is called from database....

how to put the session(" date") in that textbox ???????????

PLS HELP ... THANKS THANKS
Jul 15 '07 #1
8 1500
lyealain
102 100+
pls help.......................
Jul 17 '07 #2
danp129
323 Expert 256MB
hi...
assume that in pageA i have a dropdown box.., so when i click the value in the dropdown box.. and the value will come out in the textbox below..

<input type="textbox" name= "date1" value=<%rsGet.field("date")%> >

so if i want to update that date in the textbox.. the update query is in page B

if the value is correct then .. fine.. can update...

but if let say value is wrong..
page B
[PHP]session("date") = request.form ( " date1" )
if session(" date ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]

HOW DO I MAINTAIN THE DATA FOR KAKAKA WHICH USER JUST KEY IN TO PAGE A...


it is because in pageA... that textbox data is called from database....

how to put the session(" date") in that textbox ???????????

PLS HELP ... THANKS THANKS
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim dteUserDate
  3. if session("date")<>"" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
  4. %>
  5. <input type="textbox" name= "date1" value=<%=dteUserDate%>>
Personally I tend to keep everything on one page and use session variables sparingly since the memory holding the session variables will be taken up until the session times out.
Jul 17 '07 #3
lyealain
102 100+
which mean in page B i put

[PHP]if session(" date ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]
in page A i put

[PHP]<%
Dim dteUserDate
if session("date")="KAKAKA" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
%>
<input type="textbox" name= "date1" value=<%=dteUserDate%>[/PHP]

but in page B i have a lot of
[PHP]if session(" date ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]

[PHP]if session(" date2 ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]

[PHP]if session(" date3 ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]
..........
..........
............

so in page A..
<%
Dim dteUserDate
if session("date")="KAKAKA" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
%>

<%
Dim dteUserDate
if session("date2")="KAKAKA" then dteUserDate=session("date2") else dteUserDate=rsGet.field("date2")
%>

need to declare like that ????
Jul 17 '07 #4
danp129
323 Expert 256MB
which mean in page B i put

[PHP]if session(" date ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]
in page A i put

[PHP]<%
Dim dteUserDate
if session("date")="KAKAKA" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
%>
<input type="textbox" name= "date1" value=<%=dteUserDate%>[/PHP]

but in page B i have a lot of
[PHP]if session(" date ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]

[PHP]if session(" date2 ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]

[PHP]if session(" date3 ") = " KAKAKA"
response.redirect(" pageA.asp?res=DateBlank")[/PHP]
..........
..........
............

so in page A..
<%
Dim dteUserDate
if session("date")="KAKAKA" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
%>

<%
Dim dteUserDate
if session("date2")="KAKAKA" then dteUserDate=session("date2") else dteUserDate=rsGet.field("date2")
%>

need to declare like that ????
I'd prolly do something like this on page A

Expand|Select|Wrap|Line Numbers
  1. Dim dteUserDate
  2. Dim dteUserDate2
  3. Dim dteUserDate3
  4. if session("date")="KAKAKA" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
  5. if session("date2")="KAKAKA" then dteUserDate2=session("date2") else dteUserDate=rsGet.field("date2")
  6. if session("date3")="KAKAKA" then dteUserDate3=session("date3") else dteUserDate=rsGet.field("date3")
  7.  
  8. ...
  9.  
  10. <input type="textbox" name="date1" value=<%=dteUserDate%>
  11. <input type="textbox" name="date2" value=<%=dteUserDate2%>
  12. <input type="textbox" name="date3" value=<%=dteUserDate3%>
Jul 18 '07 #5
lyealain
102 100+
thanks... but for my page A /.. i have a form..
...
[PHP]<form action="???" enctype="multipart/form-data" method="post">
<input type="textbox" name="date1" value=<%=dteUserDate%>
<input type="textbox" name="date2" value=<%=dteUserDate2%>
<input type="textbox" name="date3" value=<%=dteUserDate3%>[/code][/quote]


<tr>
<td>&nbsp&nbsp</td>
<td width="100"><FONT FACE="Arial" SIZE="2" COLOR="#000000"><B>Upload Image</font></td>
<TD BGCOLOR="#EEEEEE">

<INPUT TYPE="file" NAME="myFile" name="file1" SIZE="40">&nbsp&nbsp
</td>
</tr>

</form>[/PHP]

what should i put for the action? page A or page B
because the verification in in page A

and i have the uploading funciton in page B...

if i put the action as pageA.. then is it
[PHP]
#
if session("date")="KAKAKA" then dteUserDate=session("date") else dteUserDate=rsGet.field("date")
#
if session("date2")="KAKAKA" then dteUserDate2=session("date2") else dteUserDate=rsGet.field("date2")
#
if session("date3")="KAKAKA" then dteUserDate3=session("date3") else dteUserDate=rsGet.field("date3")

else <form action="pageB"> </form>

[/PHP]

i used to verify something in another page... but don knwo how to do it in a single page... pls help...
Jul 18 '07 #6
danp129
323 Expert 256MB
Try somthing like this
Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3. 'Dim rsGet    'your recordset object
  4. 'Dim cn        'your connection object
  5. 'Dim strCon    'your connection string
  6. 'Dim strSQL 'your SQL query
  7. 'sCon="your connection string"
  8. 'set rsGet=CreateObject("adodb.recordset")
  9. 'set cn=CreateObject("adodb.connection")
  10. 'cn.open strCon
  11.  
  12. Dim dteUserDate1
  13. Dim dteUserDate2
  14. Dim dteUserDate3
  15. Dim errMsg
  16.  
  17. if Request.Form("sub")="" then
  18.     'The form was not submitted so prepare to show the form
  19.     'ie set any default values you want to show in the form
  20.  
  21.     'strSQL="SELECT whatever from whatever"
  22.     'rsGet.Open strSQL, cn, 1, 1
  23.     dteUserDate1=rsGet("date1")
  24.     dteUserDate2=rsGet("date2")
  25.     dteUserDate3=rsGet("date3")
  26.     call ShowForm
  27. else
  28.     'The form was submitted so validate data
  29.     dteUserDate1=Request.Form("date1")
  30.     dteUserDate2=Request.Form("date2")
  31.     dteUserDate3=Request.Form("date3")
  32.  
  33.     if dteUserDate1 <> "what you want it to equal" then errMsg=errMsg & "<BR>Date1 is incorrect"
  34.     if dteUserDate2 <> "what you want it to equal" then errMsg=errMsg & "<BR>Date2 is incorrect"
  35.     if dteUserDate3 <> "what you want it to equal" then errMsg=errMsg & "<BR>Date3 is incorrect"
  36.  
  37.     if errMsg <> "" then
  38.         'There was an error of some type so show the form
  39.         call ShowForm
  40.     else
  41.         'no errors with user submitted data
  42.  
  43.         'put your code here to update the database
  44.  
  45.     end if
  46. end if
  47.  
  48. call cleanup
  49. 'This is the end of the main code, the sub procedures below are called from above
  50.  
  51.  
  52. Sub Cleanup
  53.     on error resume next
  54.     'close recordset if open and remove reference
  55.     rsGet.Close
  56.     set rsGet=nothing
  57.     'close db connection  if open and remove reference
  58.     cn.Close
  59.     set cn=nothing
  60. end sub
  61.  
  62. sub ShowForm
  63.  
  64.     if errMsg<>"" then Response.Write errMsg
  65.  
  66.     'If you don't specify an action, the form will post to the same page
  67.     %>
  68.     <form enctype="multipart/form-data" method="post">
  69.     <table>
  70.     <tr>
  71.         <td><input type="textbox" name="date1" value="<%=dteUserDate%>"></td>
  72.         <td><input type="textbox" name="date2" value="<%=dteUserDate2%>"></td>
  73.         <td><input type="textbox" name="date3" value="<%=dteUserDate3%>"></td>
  74.     </tr>
  75.     <tr>
  76.         <td>&nbsp&nbsp</td>
  77.         <td width="100"><FONT FACE="Arial" SIZE="2" COLOR="#000000"><B>Upload Image</font></td>
  78.         <TD BGCOLOR="#EEEEEE">            
  79.  
  80.         <INPUT TYPE="file" NAME="myFile" name="file1" SIZE="40">&nbsp&nbsp
  81.         </td>
  82.     </tr>
  83.     <tr>
  84.         <!--PS NEVER use "submit" as the NAME of a submit button!-->
  85.         <input type=submit name=sub value="Submit">
  86.     </tr>
  87.     </table> 
  88.     </form>
  89. <%
  90. end sub
  91. %>
Jul 18 '07 #7
lyealain
102 100+
[PHP]if request.form("SAVE")="AA" THEN

if request.form("plan3")="" then
msg="yoo"
else
response.redirect("login.asp")
end if
end if [/PHP]
i test a textbox in a form...
after submit..if left blank.. show yoo..
else go to login.asp..

but why it give error on
Microsoft VBScript runtime error '800a01a8'

Object required: 'response'

error at the response.redirect("Login.asp")

why arr??
Aug 24 '07 #8
markrawlingson
346 Expert 100+
Drop the parantheses ( )

Response.Redirect "login.asp"
Aug 29 '07 #9

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

Similar topics

1
by: Kathy | last post by:
Hi All I have a problem - I have an visual basic application that I am currently converting to .Net - I have a very necessary function that disconnects users from files on a specific network...
1
by: Jenny | last post by:
Need urgent help for an unsolved problem. In our ASP web application, we creat a Back button and if user click on this button, it execute history.go(-1) to go back to the previous page. All our...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
7
by: Thaynann | last post by:
I am developin an application that access a web site, i can get to the first page of the site, but when i POST to get to other pages, it gives me a message (amongst the HTML code) "Session Timed...
0
by: Mae | last post by:
Dear all, I having a problem here. The situation is as follow, I have a web system with is using C#, if error occur it will capture the error in Global.asax.cs in "Application_Error" and it will...
4
by: Nick | last post by:
Hi I am a little stuck. I have a web app which uses cookieless session management. I would like to inform a user when their session has ended but cannot work out how to implement. I thought...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
1
by: AnanthaMarella | last post by:
Dear Friends, Hi Getting problem when i try to keep one of my VB DLL object in ASP Sessions. here is the sample code, i am creating object for Rational Clear Quest Bug Tracking tool (IBM tool) ...
2
by: itsvineeth209 | last post by:
My task is to create login control without using login control in tools. I shouldnt use sqldatasource or any other. I should use only data sets, data adapters and data readers etc. U had created...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.