473,499 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Session object not passing through

Hi, I have a rather puzzling problem, have asked the ASP experts at work with
no joy and its driving me mad! I'll explain the steps in more detail below
but the general problem is I am manually creating a datetime value in my asp
pages that I am putting in a session. Now this isn't being passed from page
to page while other session objects are. There is no reason I can see for
this happening.

The steps I am using are:

page1.asp - A form where the user selects a time from a drop down menu that
then passes a value in the form to the next page

<select name="timeselection" class="formelements" id="timeselection">
<option value="6/21/2004 12:00:00">12:00</option>
<option value="6/21/2004 12:30:00">12:30</option>
<option value="6/21/2004 13:00:00">13:00</option>
<option value="6/21/2004 13:30:00">13:30</option>
<option value="6/21/2004 14:00:00">14:00</option>
<option value="6/21/2004 14:30:00">14:30</option>
<option value="6/21/2004 15:00:00">15:00</option>
</select>

page2.asp - The page asks the user to login or register. It posts back to
itself to check the username and password is correct. If I write out
Session("timeselection") it displays perfectly

timeselection = Request.Form("timeselection")
Session("timeselection") = timeselection

If Request.Form("username") <> "" THEN
formname = Request.Form("username")
formpass = Request.Form("password")
sSQL = "SELECT tbl_user.fld_user_uid, tbl_user.fld_firstname,
tbl_user.fld_surname, tbl_user.fld_email, tbl_user.fld_username FROM tbl_user
WHERE tbl_user.fld_username='"&formname&"' AND
tbl_user.fld_password='"&formpass&"'" Set Rs = Con.Execute(sSQL)
IF rs.EOF AND rs.BOF THEN
ELSE
Session("name") = Rs("fld_firstname")
Session("custid") = Rs("fld_user_uid")
Session("Authenticated") = "1"
Response.Redirect("/confirm.asp")
END IF
ELSE
END IF

page3.asp - Should display the confirmation details from the past selections.
All the sessions work apart from the timeselection, it just appears blank. If
I add a bit of text to timeselecion when i declare the session this appears
so it is passing something through. Its driving me mad!

timeselection = Session("timeselection")
custname = Session("name")

'in body works
=(name)
'doesn't display
=(timeselection)
Jul 19 '05 #1
4 1621
Do you mean that if you try something like :
timeselection="[" & Request.form("timeselection") & "]"
on your postback it will be seen as "[]" in the confirmation page ?

It looks like that Request.Form("timeselection") is empty. Could it be
outside of the form tag ? Display Request.Form to see if its part of the
posted data...

Patrice

--

"bateman" <ba********@nospam.hotmail.com> a écrit dans le message de
news:er*************@tk2msftngp13.phx.gbl...
Hi, I have a rather puzzling problem, have asked the ASP experts at work with no joy and its driving me mad! I'll explain the steps in more detail below
but the general problem is I am manually creating a datetime value in my asp pages that I am putting in a session. Now this isn't being passed from page to page while other session objects are. There is no reason I can see for
this happening.

The steps I am using are:

page1.asp - A form where the user selects a time from a drop down menu that then passes a value in the form to the next page

<select name="timeselection" class="formelements" id="timeselection">
<option value="6/21/2004 12:00:00">12:00</option>
<option value="6/21/2004 12:30:00">12:30</option>
<option value="6/21/2004 13:00:00">13:00</option>
<option value="6/21/2004 13:30:00">13:30</option>
<option value="6/21/2004 14:00:00">14:00</option>
<option value="6/21/2004 14:30:00">14:30</option>
<option value="6/21/2004 15:00:00">15:00</option>
</select>

page2.asp - The page asks the user to login or register. It posts back to
itself to check the username and password is correct. If I write out
Session("timeselection") it displays perfectly

timeselection = Request.Form("timeselection")
Session("timeselection") = timeselection

If Request.Form("username") <> "" THEN
formname = Request.Form("username")
formpass = Request.Form("password")
sSQL = "SELECT tbl_user.fld_user_uid, tbl_user.fld_firstname,
tbl_user.fld_surname, tbl_user.fld_email, tbl_user.fld_username FROM tbl_user WHERE tbl_user.fld_username='"&formname&"' AND
tbl_user.fld_password='"&formpass&"'" Set Rs = Con.Execute(sSQL)
IF rs.EOF AND rs.BOF THEN
ELSE
Session("name") = Rs("fld_firstname")
Session("custid") = Rs("fld_user_uid")
Session("Authenticated") = "1"
Response.Redirect("/confirm.asp")
END IF
ELSE
END IF

page3.asp - Should display the confirmation details from the past selections. All the sessions work apart from the timeselection, it just appears blank. If I add a bit of text to timeselecion when i declare the session this appears so it is passing something through. Its driving me mad!

timeselection = Session("timeselection")
custname = Session("name")

'in body works
=(name)
'doesn't display
=(timeselection)

Jul 19 '05 #2
"Patrice" <no****@nowhere.com> wrote in news:OCegOi5UEHA.2484
@TK2MSFTNGP11.phx.gbl:
Do you mean that if you try something like :
timeselection="[" & Request.form("timeselection") & "]"
on your postback it will be seen as "[]" in the confirmation page ?

It looks like that Request.Form("timeselection") is empty. Could it be
outside of the form tag ? Display Request.Form to see if its part of the
posted data...

Patrice

If I do something like
Session("timeselection") = "[" & Request.form("timeselection") & "]"
timeselection = Session("timeselection")
on the page I declare it it will display [6/21/2004 15:00:00] if I
Response.Write (timeselection) however on the next page if I do

timeselection = Session("timeselection")
Response.Write (timeselection)
it will dispaly []
Jul 19 '05 #3
When you display the login form on page2.asp include a hidden form field for
timeselection. What is happening is that when page1 posts to page2
"timeselection" has a value. When page2 posts to itself there is no
"timeselection" form element so the timeselection variable is set to "" (or
empty?).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"bateman" <ba********@nospam.hotmail.com> wrote in message
news:er*************@tk2msftngp13.phx.gbl...
Hi, I have a rather puzzling problem, have asked the ASP experts at work with no joy and its driving me mad! I'll explain the steps in more detail below
but the general problem is I am manually creating a datetime value in my asp pages that I am putting in a session. Now this isn't being passed from page to page while other session objects are. There is no reason I can see for
this happening.

The steps I am using are:

page1.asp - A form where the user selects a time from a drop down menu that then passes a value in the form to the next page

<select name="timeselection" class="formelements" id="timeselection">
<option value="6/21/2004 12:00:00">12:00</option>
<option value="6/21/2004 12:30:00">12:30</option>
<option value="6/21/2004 13:00:00">13:00</option>
<option value="6/21/2004 13:30:00">13:30</option>
<option value="6/21/2004 14:00:00">14:00</option>
<option value="6/21/2004 14:30:00">14:30</option>
<option value="6/21/2004 15:00:00">15:00</option>
</select>

page2.asp - The page asks the user to login or register. It posts back to
itself to check the username and password is correct. If I write out
Session("timeselection") it displays perfectly

timeselection = Request.Form("timeselection")
Session("timeselection") = timeselection

If Request.Form("username") <> "" THEN
formname = Request.Form("username")
formpass = Request.Form("password")
sSQL = "SELECT tbl_user.fld_user_uid, tbl_user.fld_firstname,
tbl_user.fld_surname, tbl_user.fld_email, tbl_user.fld_username FROM tbl_user WHERE tbl_user.fld_username='"&formname&"' AND
tbl_user.fld_password='"&formpass&"'" Set Rs = Con.Execute(sSQL)
IF rs.EOF AND rs.BOF THEN
ELSE
Session("name") = Rs("fld_firstname")
Session("custid") = Rs("fld_user_uid")
Session("Authenticated") = "1"
Response.Redirect("/confirm.asp")
END IF
ELSE
END IF

page3.asp - Should display the confirmation details from the past selections. All the sessions work apart from the timeselection, it just appears blank. If I add a bit of text to timeselecion when i declare the session this appears so it is passing something through. Its driving me mad!

timeselection = Session("timeselection")
custname = Session("name")

'in body works
=(name)
'doesn't display
=(timeselection)

Jul 19 '05 #4
For now I would say that :
1) you save the correct value and displayt that value ("[MM/DD/YYYY]")
2) for some reason you go again on this page but without form values (and
you save "[]")
3) you redirect to the confirmation page that displays "[]"

For now it looks like to me you are hitting twice the
Session("timeselection") = "[" & Request.form("timeselection") & "]" (and
the latter one wihtout anything in Request.Form("timeselection").

Especially I noticed that the timeselection session var is always defined in
your code while the other session variables are defined in an if branch.
Double check your processing flow. Make sure you don't erase the session
variable by another incorrect value (you could output its value before
assignation to make sure you don't replace [MM/DD/YYYY] by [] at some point
before proceeding to the final page.

Good luck.

--

"Bateman" <ba********@nospamiehotmail.com> a écrit dans le message de
news:Xn*********************************@207.46.24 8.16...
"Patrice" <no****@nowhere.com> wrote in news:OCegOi5UEHA.2484
@TK2MSFTNGP11.phx.gbl:
Do you mean that if you try something like :
timeselection="[" & Request.form("timeselection") & "]"
on your postback it will be seen as "[]" in the confirmation page ?

It looks like that Request.Form("timeselection") is empty. Could it be
outside of the form tag ? Display Request.Form to see if its part of the
posted data...

Patrice

If I do something like
Session("timeselection") = "[" & Request.form("timeselection") & "]"
timeselection = Session("timeselection")
on the page I declare it it will display [6/21/2004 15:00:00] if I
Response.Write (timeselection) however on the next page if I do

timeselection = Session("timeselection")
Response.Write (timeselection)
it will dispaly []

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7766
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:...
0
3923
by: renster | last post by:
I was wondering if someone could help me with a problem that I'm having in retrieving session variables on a site I am working on for a friend. I have made the site more developer friendly by...
3
2545
by: Peter Redding | last post by:
Forgive me if this doesn't make too much sense but I've been working on this project all day and my brain is a bit fried. To make some of my code more readable I made a file (called urls.inc)...
3
412
by: Fran García | last post by:
I´ve a big problem with the session variables. I load audio files into media player using as src a php script that check some session variables and then load the audio file, something like that ...
10
2396
by: Buck Rogers | last post by:
Hi guys! Does anyone have a link to a site that provides up to date programming book reviews? I looked through the reviews at: http://www.accu.org/bookreviews/public/index.htm ...
2
1557
by: genc_ymeri | last post by:
Hi, Well, I'm looking around for another opinion. We have two webservers, the legacy one writen in ASP and the new one in ASP.Net. Once a user logs in the ASP.Net web app, the session of the...
10
1660
by: melissa.nava | last post by:
Here is my code: ***** Public Property DOB() As Date Get Try DOB = (msBirthMonth + "/" + msBirthDay + "/" + msBirthYear)
4
11383
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
13
8625
by: Samir Chouaieb | last post by:
Hello, I am trying to find a solution to a login mechanism for different domains on different servers with PHP5. I have one main domain with the user data and several other domains that need...
0
7131
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,...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.