|
-
May 15th, 2000, 02:03 AM
#1
Thread Starter
Member
I am new to cookies... I have attempted to run this test script to see why my original cookies script won't work and I am recieving the following error message:
========================================================
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method
/secure/manage/cookie/COOKIELIST.ASP, line 5
========================================================
Here is my code for the error message listed above:
========================================================
<%@ LANGUAGE=VBScript %>
<%
IF LEN(RESPONSE.COOKIES("TEST")) = 0 THEN
RESPONSE.WRITE "YOU DO NOT ACCEPT COOKIES!"
ELSE
RESPONSE.WRITE "YOU ACCEPT COOKIES!"
END IF
%>
<html>
<head>
<title>New Page 1</title>
</head>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
</body>
</html>
========================================================
And here is the code for the page that is supposed to create the cookie and redirect to this page listed above:
========================================================
<%@ Language=VBScript %>
<%
RESPONSE.COOKIES("TEST") = "TESTING"
RESPONSE.REDIRECT "COOKIELIST.ASP"
%>
<html>
<head>
<title>New Page 1</title>
</head>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
</body>
</html>
========================================================
-
May 15th, 2000, 03:43 PM
#2
Frenzied Member
I think you're getting your requests and responses mixed up!
http://www.irt.org is a useful site
Code:
<%
' SET A TEXT STRING
Response.Cookies("test") = "this value"
IF len( Request.Cookies("test")) = 0 THEN
RESPONSE.WRITE( "YOU DO NOT ACCEPT COOKIES!")
ELSE
RESPONSE.WRITE( "YOU ACCEPT COOKIES!")
END IF
%>
<html>
<head>
<title>New Page 1</title>
</head>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
</body>
</html>
-
May 15th, 2000, 09:20 PM
#3
Thread Starter
Member
Cool... that works... so now i guess the problem is in my code... here is my original project that I was working with...
I am getting NO error message... but on the same note... the text I am submitting on the first page is not being passed on via cookies to the second page...
Kind Regards,
Hakan
CODE FROM THE MAIN PAGE:
============================================================
<%@ Language=VBScript %>
<% Option Explicit %>
<%
IF NOT ISEMPTY(Request.Form("Submit")) then
Response.Cookies("HaKCOOKIE")("FirstName") = request.form("txtFNAME")
Response.Cookies("HaKCOOKIE")("LastName") = request.form("txtLNAME")
Response.Cookies("HaKCOOKIE").Expires = Date + 500
response.redirect "cookielist.asp"
END IF
%>
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<p><input type="text" name="txtFNAME" size="20"></p>
<p><input type="text" name="txtLNAME" size="20"></p>
<p> </p>
<form method="POST">
<p><input type="submit" value="Submit" name="Submit"></p>
</form>
</body>
</html>
CODE FROM THE RESULTS PAGE:
============================================================
<%@ LANGUAGE=VBScript %>
<%
fname = REQUEST.COOKIES("HaKCOOKIE")("FirstName")
lname = REQUEST.COOKIES("HaKCOOKIE")("LastName")
%>
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<%RESPONSE.WRITE FNAME%>
<%RESPONSE.WRITE LNAME%>
</body>
</html>
-
May 15th, 2000, 10:05 PM
#4
Frenzied Member
Your code has been shot to bits!
<form method="POST"> needs to before the <p><input type="text" name="txtFNAME" size="20"></p>
and there's no "action"
-
May 16th, 2000, 08:26 PM
#5
Addicted Member
Hi,
are the cookies actually created on your machine, i.e. can you open the file in your:
/winnt/profile/your_name/cookies/cookie_name
It dhould be there as a simple text file.
Thanks
Lenin
-
May 16th, 2000, 08:35 PM
#6
Thread Starter
Member
Thanks guys for all your help... as far as the code being shot to bits... I apologize... I guess we all have to learn somewhere...
Thanks Again,
Hakan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|