The ServerVariables Collection How Do You Use Them
I am doing a project and I have a form in which I am putting information inside cookies then I am to display the information in the cookies on another page. So when they click submit they goto this page and this is my code:
does anyone know how to define own Collection objets in ASP (not ASP.NET!) and VBScript? Is it better to use the Collections or the "Scripting.Dictionary" object?
I found this piece of code to collect info from a form and then display the information. I created seperate programs - one with the form and the other with the asp part to display the collected information.
How can I collect information in one program using "post" method and display it and get an okay from my users before I update the database? Code:
I am processing a form and I want to double check that a field is defined so that no error occurs. How do I check if a key exists in a collection (the Request.Form collection)?I do not want to process all of the fields in the form, so I do not want to use "For Each x In Request.Form". I process a certain list of fields and just in case the field was left out, I want to prevent an error from occurring from trying to use a key that does not exist.
Code:
For Each x In arrayFields 'arrayFields contains certain field names 'verify that field actually defined If [field is a key in the Request.Form collection] Then stringTemp = Request.Form(x) 'do stuff End If Next
I like how you can use the Fields collection to create tables but is there a way to dynamically produce a table and filter out certain fields without having to write the entire table out manually? For example, I don't need the record's ID field in the table.
I'm working on an ASP/Javascript page with frames, and I need to access the properties of an image in the "top" frame from a script launched by the "middle" frame.
When changing the properties in the current frame, I use
I would like to tap in to all the brilliant minds out there through the means of this question. Is it possible to have a function in asp that returns a collection of items?
If so could you please direct me to some code that may provide some insight to how its done. I've tried using my limited coding capacity but no success.
if instr(lcase(Request.ServerVariables("HTTP_REFERER")), "OrderReceipt.asp") = 0 then Doesn't that line translate to: "if the user did not come from OrderReceipt.asp then..." For some reason it will not work this way.
I want to expire a cookie collection in my asp page and I gave it like this;
Response.Cookies("whereq").Expires = Now()
and this "whereq" collection has 50 keys. The problem is my cookie didn't expire from the above code. I hope there should be a way to do so without writing 50 expire lines.
How can I retrieve the values one by one from a variable like this: chgID=48, 51, 52, 53, 54, 56, 57, 59, 58, 46, 61, 60
Actually I am getting this, from a form and I want to update records in database filtering with these IDs one at a time. I guess 'For Each' loop can do this work done, but How??
I am trying to create a string that is cencatenated from values in a form. The form pulls in the values in a reocordset and displays each record in a row with a checkbox.
I want to cencatenate the values of the ProjectName field if the checkbox (isChecked) has been checked when the form is submitted. Here is the code that i am using:
<% If (Request.Form("Submit") <> "") Then Dim Criteria Criteria = "" For Each Item in Request.Form("ProjectName") If Request.Form("IsChecked") Then Criteria = Criteria & Request.Form("Projectname") Else Next Response.write Criteria End If %>
If I get rid of the If then else statement with in the For Each statement, then all of the items will cencatenate. I am just trying to grab the rows where the user has checked in the box for the row.
can anyone tell me why it is that when i do (see the code>)
1 the value of the submit button doent match? 2 the collection returns the collection string as line one? 3. how do i jump these 2 for error check and trim replace?
Is there a way to manipulate (ie change) the items in the forms collection. I simply want to get rid of the infamous apostrophe in input from a form, replace ' with ''. I had hoped to be able just to make the change and then put it back into the Form.item. Is there a way to do this?
If not, would the best way to save the result be to build an array, which is then used instead of the forms collection? Code:
I have several hundreeds of DVDs, and friends often call me to borrow some.
I'd like to be able to have my entire collection on my web page (i have everything in a database already) and let them browse for the title they want, then "check" the ones they need and see if they're "available" or not.
Then this would send me an email with the titles and the name of the person requesting them.
Is there any ready to use solution or should I just jump into developing it myself?
If there is something, any link to a product like that? Something simple: title, cover picture, available or not.
I have an asp page in which i have a combo,in change of selected index of combo i am putting the combo value to a hidden variable then submitting the form like this
form.hid.value=1 form.target; form.submit
and again while loading the form i am checking for the value like this .request.form("hid") but i am not getting the value .what could be the problem.the method of my form is post only.
I have an asp application that I install on quite a few different servers. omally this works fine and I have never had a serious issue with it untill today.I installed the site in the normall way and was able to browse to it. But as soon as I submitted one of the forms in a page, nothing gets passed through the forms collection.
I found this strange and immedatly placed in code to iterate through the collection and display all of the values, but the collection is empty and no variables have been passed at all.
has anybody experinced this issue before and know how to fix it, I have been looking through setting in IE as I though a security update may have changed something, I'm not too sure if this is a browser issue or an IIS issue.
Is the garbage collection algorithm used in JavaScript on ASP based on reference counting or tracing? (I'm planning on creating some user defined Objects with lots of cyclic references (e.g., a.next.prev = a), and would like to know if this will cause a problem for the garbage collector. The fact that garbage collection in general isn't instantaneous suggests to me that it isn't based on reference counting, but I just want to be sure.)
I am trying to use Request.ServerVariables("SCIPT_NAME") - this is ok normally, but when I try to use the script behind SSL - it does not pick up the full path to where I am - eg:
Request.ServerVariables("SCIPT_NAME") in this file, would show: https://sslrel.com/Default.asp Which makes all my redirects etc - not work! Is this a known feature of SSL, or has it just been setup incorrectly?
Our intranet was running on a Windows NT4 server using IIS4. We have just upgraded to Windows 2000 & IIS 5 but we are now having a few problems. A lot of our code uses Request.ServerVariables("auth_user") to get the users logon name. This used to work fine but now it doesn't work at all. We don't get an error, just a blank value. I have searched around for help but it seems that there is no reason why it shouldn't work, which makes me think that maybe it's not the code that's the problem.
Why does Request.ServerVariables("AUTH_USER") suddenly start returning a 0 length string? I've experience this before...it works fine for a while and suddenly it quits returning values. Other ASP on the same server continues to return valid values. Any ideas what is causing this?
I have a asp page that use the request.ServerVariables("Logon_user"). I'm used fine but then i need to restart the web server. After that request.ServerVariables("Logon_user") has no value, a null string.Why?and How can resolve this problem?
I have had issues with Request.ServerVariables("HTTP_REFERER") because it seems that in many cases it returns an empty string or NULL value. I use it when it works correctly to enable my scripts to be somewhat universal, not requiring hard coded values or "email an associate" scripts etc.
I just noticed that a script I'm working on does work in FireFox but not in IE. I've run the script in XPPro as well as Win2K Server to rule out it being a local setup problem. It seems that if I use Javascript to open an new window FireFox recognizes the referer but IE does not.
I realize this is probably a difference in the way IE handles the Javascript function of opening the window but as it is a Request.ServerVariable that is not being passed maybe someone else in ASP-land has run into it and knows a fix.
i want to know the usage of Request.ServerVariables.I'm not sure this is really a ASP question,so redirects to a more appropriate newsgroup are welcome.
I have a variable that is being passed to me through HTTP headers "Test."I am able to see this variable and its value when I use Request.ServerVariables("ALL_HTTP").
when I iterate through Request.ServerVariables using a "For Each key in Request.ServerVariables" the key of "Test" comes up.However, when I use Request.ServerVariables("Test"), the value returned to me is always empty.
I want to have one of my asp pages ONLY load if someone reached it by my main page. I am new to ASP, but I think I have the theory down, I just need help with the actual commands, syntax, etc... Here is what I got so far, any suggestions?
ref=Request.ServerVariables("HTTP_REFERER") If ref=http://website.com/main_page.htm then goto continue Else goto end
continue() ..... run the code on this page .....
end() Response.Write "You Have Not Reached This Page From Our Main Site"
I have an ASP page which collects the "logon_user" and assigns different permissions based on their "names". It is working properly under Windows 2000/XP, but Windows 9? is NOT recognizing. Could anyone tell me what I have missed? Updating new versions or changing my code?
I have written an application that catches the logon user's name in order to assign different levels of permissions, but the users logon under different OS (Windows versions).
the "logon_user" is recognized under Windows 2000/XP but not Windows9x. The server is under Windows 2000 which connects all kinds of workstations with different OS. Do I need to update the pathes of Windows9x or I need to use different Server variable to catch up the logon user's name?