Setting Cookies From Inside Function
I have a function that I'm using to loop through some db query results and put them into a table. Inside the function, I have a line to add certain values to a series of cookies (kind of like a cookie array) as such:
response.cookies("sclot" & ZZ) = LotNum
'response.write(request.cookies("sclot" & ZZ))
If I uncomment the second line, I pull my values just fine from inside the function. The problem is, if I use the exact same line to try to pull the values outside of the function, or from another page, it returns nothing. The whole reason I'm putting these values into cookies is so that I can pull this list up on another page, but I don't seem to be able to. Is there some reason that I would not be able to read a cookie that I set inside a function outside of it?
View Replies
ADVERTISEMENT
I am not able to set cookies with the domain name on a
Windows 2000 server with IIS 5.0. If I use the IP address
it works. I have another machine running IIS and I
configured them together.
View Replies
View Related
I have a simple textbox in a form, and I want to set a cookie in the whole process, plus go to a new ASP page. Here's the code for setting the cookie:
<% Response.Cookies("FirstName")='(contents of text box)' %>
but I don't see where to put it in the input form. Am I able to set a cookie and process the form to go to the second page, all on the first form? Can someone enlighten me?
View Replies
View Related
PHP Code:
<%
If (not (session("MM_UserAuthorization") = "")) Then
Response.cookies ("UserAuthorization")=Session("MM_UserAuthorization")
Response.Cookies("MM_Username")=Session("MM_Username")
Response.cookies ("UserAuthorization").Expires= Now
Response.cookies ("MM_Username").Expires= Now
strAuthorization = Session("MM_UserAuthorization")
End if
If (Request.Cookies("UserAuthorization")="") Then
Response.redirect ("login.asp")
Response.End
Else
strAuthorization = request.cookies("UserAuthorization")
End If
%>
1st Question:
Why I cannot use the [asp][/asp] for my asp code posting? I need to use the [php][/php/] which lead to display PHP: header?
2nd Question:
My codes displayed above created using the Ultradev, and since I use free member services from brinkster, which does not allow the session authentication, I "convert" the session into cookies. My question is that:
Response.cookies ("UserAuthorization").Expires= Now
Response.cookies ("MM_Username").Expires= Now
What mean ... Expires= Now, and if i want to set the cookies expire based on session (per browser), what are the codes?
View Replies
View Related
i have this script named check.asp which checks a users login.
it won't redirect to the sucess page when the login is successful, and it's got me stumped why it won't..
here's the script ....
View Replies
View Related
I have a form on a page which I need to auto set certain fields from values stored in a Cookie.
<SCRIPT LANGUAGE="vbscript">
RegisterForm.Prefix.value = Request.Cookies("store")("id1")
</SCRIPT>
That is how it is in my file yet it just appears empty but I know there is valid data in the cookie as I printed it on screen using:
<%
Response.Write(Request.Cookies("store")("id1"))
%>
So I figured maybe it was something to do with the script tags so I tried using the <% %> tags instead and I got an error saying something like Microsoft VBScript runtime object required.
View Replies
View Related
is it possible to put an ASP function inside the javascript function?
e.g.
<script language=javascript>
function sample()
{
<%
here goes the asp code
%>
}
</script>
View Replies
View Related
I'm trying to use a variable like a file and I do not know if it is possible, like this:
varfunc=chr(60)&chr(37)&"function addone(varint) : addone = varint + 1: End function"&chr(37)&chr(62)
Now I have a addone function inside varfunc.
The value of varfunc is <%function addone(varint) : addone = varint + 1: End function%>
Is it possible I use varfunc like a file or something to make the function active? There are some operator like a pointer to variable or somehow to eval like a code block?
View Replies
View Related
I have these 3 tabs that I want the user to be able to select, a variable to be set, and then each page they visit in the site to read that variable and subsequently display content based on the variable that is set. So, Sheridan tab sees "Sheridan" variable content, Gillette sees "Gillette" variable content, etc.....
View Replies
View Related
I have a function that I would like to use a session variable in. However I am not getting it to work out. I was wondering if you have define global variables inside functions like you do php or if something might be causing this?
View Replies
View Related
I'm developing an account lookup, mostly in ASP, that displays a list of radio buttons to select one account from those found in a recordset. Here is a snip of the account display, after the recordset is populated: Code:
View Replies
View Related
I am using the following to delete the contents of a cookie
Response.Cookies("maincookie").expires = DateAdd("d",-2,now)
Response.redirect "login.asp"
If i try to alert the value of the cookie in the same page, it shows
the old value. As well as when it is alerted from the login.asp it
shows the old value.
The problem is when i try to update the value of the cookie in the
login page, it does not update the new value.
Only if i close the browser and reopen, the new value gets updated and
even if the old value is originally present in the cookie.
I am specifying the domain and path when creating the cookie. the
expires property is set to date + 1 when creating.
What should be done to delete the contents of the cookie? Should i
specify the domain as well as path when changing the expires property?
View Replies
View Related
Can I define a function inside a function. e.g;
function abc()
function xyz()
....some code.....
End Function
End Function
I googled this but can't find any related topic.
View Replies
View Related
In my Session_OnStart in Global.asa, I am setting some cookies. One
of them, I set as follows:
dim UserID
UserID = Request.ServerVariables("LOGON_USER")
Response.Cookies("User")("ID") = UCASE(UserID)
When I immediately log the cookie value retrieved from
Request.Cookies("User")("ID") into the Windows Event Log, I get the
correct value. However, when I try to retrieve the cookie on the home
page of my application using the same code,
Request.Cookies("User")("ID"), it either cannot find the cookie or
cannot read the value. I am retrieving the cookie before all HTML
headers are written. It is my first statement on the page after
Option Explicit. I have even compared the session IDs. The SessionID
created in the Session_OnStart is the same value as the SessionID on
the home page.
I have read that the Session_OnStart only has access to the
Application, Session and Request objects. It does not explicitly say
that it does not have access to the Response object. Also, I was even
able to use Response.Write's in Global.asa to print out the values
although it looked like it had also stopped the session after I did
so. Cookies are definitely enabled on my machine. I have even tried
setting the session cookie's expiration to be persistent for a few
days to see if it was perhaps expiring before I was able to read it
but this did not work either.
Is there something preventing cookies to be created in Global.asa in
the Session_OnStart sub? Is the Response object not available???
Please let me know if anyone else has had this problem or solution.
View Replies
View Related
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be
reading in online articles?
View Replies
View Related
I m creating a cookies in my application and it work properly but i can't see the cookies where it will sotred i checked the cookies folder but i didn't find that I want to create a cookies file as the other web site create and store where other cookies will stored in Cookies folder or Temprory Internet files folder eg:1. arvind@google.co[1].txt this stored in cookies folder 2. arvind@msn[2].txt ....
View Replies
View Related
I have a front end with all the code and a backend with some tables. Want to convert this into website database. Most probably convert the frontend into ASP. Is this the only way? Can one use the VBA code inside ASP with translating the VBA into ASP?
View Replies
View Related
I need to do a loop with some criterias that depends on an earlier database
query. I tried to do it this way, but it seems not to accept that the do
is inside the if:
if not objrs.EOF then
Do until updatearray(0) < objrs("updated")
else
Do While not fso.AtEndOfStream
end if
Blabla my repeating script here...
Loop
I'm getting this error:
Microsoft VBScript compilation error '800a03fb'
Expected 'Loop'
/x.asp, line 46
else
^
It seems somehow that the do is "stronger" than the if statement, as it didn't
even help doing it this way: Code:
View Replies
View Related
I've inherited webmaster duties for a website done in ASP.NET. After much trial and error I've figured out the architecture of the site, and have a template for the area of the page that contains the content. I need to pop in a dropdown menu, nothing fancy, like the one on this Post New Thread page for "Category".
Does anyone know where I can get the syntax for one? Or does someone know ASP.NET and can write out a simple dropdown menu code for me?
View Replies
View Related
I've put a div red with some text inside a TD, but its height is less than 100% of TD height as you can see.
I've defined the following styles:
div.test { background-color:red; height:100%; width: 100%; }
table.test { border: 1px solid #CCCCCC; background-color:yellow; }
td.test { border: 1px solid #CCCCCC; }
does anyone know a solution ? Code:
View Replies
View Related
I see that you can have HTML code inside an asp file.
Can you have php code inside an asp file
View Replies
View Related
I need to make a search to search our database that can be put on different customers websites. So I was planning on making the search a reusable asp.net control. But a lot of our customers websites are written is ASP. So Is it possible to call an asp.net control inside an asp page?
View Replies
View Related
is it possible to do a for loop inside of a Do while not.
View Replies
View Related
Is it common practice to create a recordset object inside of a loop? Does it create multiple connections to the database?
View Replies
View Related
I have a form which consists of Iframe
<Form method="pst" action="test.asp">
<iframe src="testingframe.asp" id="testfram" frameborder="1"
scroll="auto">
</iframe>
</Form>
testingframe.asp has
<table>
<td>
<tr>
<input type=checkbox id="checkedName" name="checkedName"/>
</tr>
</td>
</table>
How do i acess checkedName value in my main form .... ?
View Replies
View Related
We need to display certain websites inside a frame on our website and I use the response.redirect command in VBScript.
The problem is that some websites take over the whole browser, how can I stop this and force a website to be loaded inside a frame?
View Replies
View Related
Could anyone tell me how to select the first three characters in a string, then put inside into another string.
View Replies
View Related
I need to write a search function which should be able to search text within PDF documents and (if possible) creat a link to that document / page .
View Replies
View Related
Having an issue trying to access a variable that is populated by a value inside a recordset that I want to use in another statement. I've included the source code below:
" Do While Not objRSZone.EOF
strSuburb = objRSZone("suburb")
strZone = objRSZone("zone")
strPostCode = objRSZone("postcode")
If frmSuburb = strSuburb Then
Response.Write "Zone for " & strSuburb & " = " & strZone & " , Postcode = " & strPostCode & "<br>"
strShipZone = strZone
Response.Write strShipZone
End If
objRSZone.MoveNext
Loop "
So what I want is to use the strShipZone variable somewhere other than this place above. But it doesnt work, as it is on the loop, if i put it outside the loop it is populated by a wrong value.
View Replies
View Related
How can I send messages to user like messageBox from a ASP page without doing postback over the page.
View Replies
View Related
How do you put an asp code inside an html tag?
This is not working:
<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>">Send a message</a>
I am actually putting above info in an Access field. People would be able to send me email through a form in contact.asp and I want the subject line reflect which page they came from.
View Replies
View Related
Was thinking of having an array inside a asp page. I'm rather new to this.How do I begin. my asp page should work as follows.One html page include mail adresses. We receive a lot of junk mail and I was thinking of how to avoid this. Was thinking of creating a asp page with an inout string inside the asp page. The input number should refer to the users mail adress.
We are only four people in our office, so that should be simple to manage.The html code should be like "redirect.asp?" for the first mail adress. and redirect.asp?What's the syntax inside the asp page?
View Replies
View Related
I'm currently new to OO programming with Classic ASP and have been stopped dead in my tracks on the issue of validation inside classes and if I should be doing things that way. I have been using a User class and it has methods such as Save(), Update() and Delete(). Particularly with the Update() method I'm unsure if I should be validating my form(s) within the class or on the actual edit.asp page that uses the Update() method?
I have two types of edit pages; one for Admin users and one for the My Account page. On the My Account page if the user wants to change their password they have to enter their current password, a new password and then their new password again to confirm .
If an Admin user is updating that same user's info they do not have to go through those steps and they can simple just change the password by typing it in. The point here is that there are two separate cases of validation rules on two separate pages that both use the Update() method. Do you validate your forms inside your classes or outside?
View Replies
View Related