Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    ASP




Request.ServerVariables With A Variable.


<%
If Request.ServerVariables("REMOTE_ADDR") = "12.5.14.%" Then
%>

does anyone know how i can make my page only show info if they come from
a certain ip RANGE? not a static ip?

is there a wildcard i can put above instead of % to make that work for all 255 choices of
ips?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Request.ServerVariables
Request.ServerVariables(&quot;HTTP_REFERER&quot;)can that be spoofed?

Request.ServerVariables
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:

https://sslrel.com/sslcert.mysite.co.uk/Default.asp

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?

Request.ServerVariables
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.

Request.ServerVariables
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?

Request.ServerVariables
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.

Request.ServerVariables
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.

Request.ServerVariables
I am trying to ensure that Request.ServerVariables can not be spoofed. Does anyone know?

Request.ServerVariables
Is there a way to find the url of a page, in html page, and not in asp page? Anything like Request.ServerVariables("URL") in jscript?

Request.ServerVariables
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"

Request.ServerVariables
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?

Request.ServerVariables Question
i would like to capture the server variables from a remote server in our
org. is this possible ??

Request.Servervariables Question
Isn't there an argument that you can ask for that tells you the name of the page that someone was at just before they came to your page? I tried a search in the MSDN
Library, but I can't find anything....I thought it was HTTP_REFERRER or something.

Request.servervariables Question
i know that HTTP_REFERER will grab the referring page, but here is my question. say someone has clicked a link from google to get to www.site.com/somepage.html, how can i get this url instead of the refering google page?

Request.ServerVariables Issue
I am running Server 2003 and ASP. I used the following code to loop through the variable collection:

for each obj in Request.ServerVariables
response.write "Object Name: " & obj & "<BR>" & "Object Value: " & Request.ServerVariables(obj) & "<BR><BR>"
next

I got the list of all the possible objects as expected, but the majority of the values were blank. I am designing my site so that there is a seemless login capability. When you log into the domain, your credentials are verified through NT. I was going to use one of the available server variables to grab the user name for login purposes, but found all the values blank.

Is there a known bug/issue? Is there a configuration setting in the IIS MMC that I have overlooked that will allow those values to be tracked by the server?

ServerVariables - Request Only Part Of The URL
I am coding a login system with login form etc. and when users are denied access to a secure page within the secure area, I want to obviously send them to the login page to check who they are and check they are allowed to view the secure content of the site.

The problem I am having is that currently, if a user is denied access to a secure page, they are sent to the login page. Once they are granted access, they should be sent back to the page they were originally trying to view and not to the main menu.

(The secure area has lots of pages and users would not be happy if they had to trawl through hundreds of pages to try and find what they wanted.

I know I need to use the ServerVariables collection to retrieve the ("URL"), but I dont want to just use this as a querystring parameter when I send a user to the login page.

This would be insecure because someone out there would find my little login script and start using it on their own site by sending users to my login script to login, and then using the querystring parameter to redirect the user back to their own site.

All I want to do is select the part of the URL after the http://www.somedomainname.co.uk/manager/ part. I cannot use a Left select or right select option because my login script will be put onto lots of different websites, and I would have to change the Left select on each different site.

Request.ServerVariables Coming Up Empty?
A few days ago all my Request.ServerVariables began coming up empty. I was using Request.ServerVariables("AUTH_USER") for basic authentication but now its useless. Our server administrator tells me he installed some "patches" last week but doesn't think he caused the problem. All I can say is that before the patch they worked fine. Anyone have any ideas on where to look for a solution?

Detecting Firefox With Request.servervariables
Can I use request.servervariables("HTTP_USER_AGENT") to determine if the user has Firefox or Internet Explorer? Is the return string differentiated enough?

Request.Servervariables("HTTP_REFERER") Versus BACK Button On Browser
When my webserver does not process a user's change because of an invalid password, I inform the user and I want to present them a button for a retry:

<TR id=continuebuttonrow>
<td width="05%">&nbsp;</td>
<TD width="90%" align=center valign=middle colspan=2>
<BUTTON TYPE=BUTTON
ONCLICK="location.href='<% =Request.ServerVariables("HTTP_REFERER") %>';"
class=btnParms name=btnContinue ID="Button3">Try Again (Back)</BUTTON>
</td>

Yet if this button is clicked, they go back to the server and the page is refreshed with original values.

If I click the browser's BACK button (rather than my button above), I go back to the page (from cache I guess) I want (because it contains the user changes). Here I can correct the password without having to rekey the changes.

So, what is the Request.Servervariable needed for the equivalent of the BACK button?

Possble To Retain Orig Request.ServerVariables("HTTP_REFERER") Thru Svrl Refreshes?
I have a "Email this page to a friend" form that submits to itself and contains the hidden input value="<%= Request.ServerVariables("HTTP_REFERER") %>".

The value="<%= Request.ServerVariables("HTTP_REFERER") %>" is to obtain the URL of the page that the person wishes to send.

The problem is, if someone creates an error in any of the input fields, the page submits to itself again and displays the errors. When this happens, the original HTTP_REFERER url address is lost and now replaced with the url of the "Email this page to a friend" page.

Is there a way to retain the original HTTP_REFERER value even though the user refreshes the page?

Not Displaying Request.ServerVariables("HTTP_REFERER")
Found this funny error on a clients computer the "request.ServerVariables("HTTP_REFERER")" does not show any information on the previous address of the last webpage visited. The computer does how every show the details of "request.ServerVariables("ALL_HTTP")".

I can't seem to be able to duplicate the problem on my computer. Does any one have any ideas why this might be happening?

Can Request.ServerVariables("REMOTE_ADDR") Fail And....?
Can Request.ServerVariables("REMOTE_ADDR") fail and catch the address of my
default gateway in my local network? What should I do?

Sometimes brings 192.168.0.1(the address of my default gateway) instead the
remode IP address: 200.200.15.2, 64.100.2.1, etc....

Request.ServerVariables("HTTP_HOST")
if i am using https, will this work the same as if i were
using http?

Request.ServerVariables("HTTP_HOST")

returns www.mywebsite.net for http.

what about https?????

"Request.ServerVariables" Question
What's the difference between

Request.ServerVariables("SERVER_NAME")

and

Request.ServerVariables("HTTP_HOST")

?

Request.ServerVariables("HTTP_REFERER")
I am trying to write a small banner system and I am trying to get the page from where the banner is displayed. I have tried this piece of code:-

page = Request.ServerVariables("HTTP_REFERER")

however with IE6, it does not work and gives me a blank variable.

Is there a way round this?

Request.servervariables("Logon_USer")
Request.servervariables("Logon_USer") is working perfectly well for one asp page returning the NT userid as expected but returning an empty string for another asp page.Both the asp pages are in the same directory.This directory have both Anonymous Access and Integrated Authentication enabled att IIS.

Request Retrurns Empty Variable.
On my asp form I have the simple code as below. The idea is that I check the client browser version and store it in BTYP. If I make BTYP a text input I can see the value OK.
When I submit and request BTYP from l0008ps.asp I get an empty variable. How
do I hold my mouth while doing this....

Request.BinaryRead :: Request Object Error 'ASP 0104 : 80004005'
Why does the error below occur whenever the statement Request.BinaryRead Request.TotalBytes) is executed for uploads larger than 100K? I thought the 100K limit applied only to Request.Form. This does not occur with smaller uploads. This is running on an IIS 6 server with full FP2002 extensions.

ERROR:
Request object error 'ASP 0104 : 80004005'
Operation not Allowed

Consecutive Request.Form And Request.BinaryRead
Request.Form and Request.BinaryRead cannot be called after each other as it causes errors.

I need the BinaryRead and I also need to access other form values, but I cannot call them after one another. What do I do?

ServerVariables
Whats wrong with this line?Code:

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.


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:

Unreliable ServerVariables?
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?

What Is The Difference Between REQUEST And REQUEST.QUERYSTRING?
What is the difference between these two statements? They seem to do the
same thing...

response.write(request("variable"))

response.write(request.querystring("variable"))

Calling Com + Object Variable Or With Block Variable Not Set
I'm turning my application into a "DLL". Everything worked fine untill I try to do a "While" in my asp code. Then I recieve an error like this:

"Object variable or With block variable not set"

My vb code look like this.....

Using Request And Request.Form
when the asp page is Request("txtName").i can use "testpage.aspx?txtName=User1" to post the value.but when i use Request.Form("txtName").i cannot use that method,what can i do to solve that problem.(as i cannot modifty the request.form syntax but i need to post data to that web page, is there any method so that i can pass that parameter?)

Convert ASP Variable To Javascript Variable
How do I convert an ASP variable to a Javascript variable?

ServerVariables("URL") Return Incorrect Pagename
From Page1.asp, I use "Server.transfer" to "REDIRECT" to another asp page
(page2.asp),
in page2.asp I use Request.ServerVariables("URL") and
Request.ServerVariables("REFERER") to get the lastpage and the actual page,
this method (or property) return incorrect values: "Page1.asp" and ""

Why?

Reques.ServerVariables("user_logon")
Is it possible to clear this environment variable in code? I want to force the end of an application session, and ensure that the if the user presses the back button in the browser they are forced to log back in.

How Do I Put A Variable And A Non Variable In A From Statement?
sql = "SELECT * FROM & console &'news'"

I got that right now but i want the variable, console to be placed along with news so when it selects from the db it selects from gcnnews or whatever variable it's on. How do I do that?

Variable-variable=junk
im trying to subtart one quantity from another then stick the answer in to an update statment, but all i get is an error in syntax message

variable math bit=
qty=request.form("oqty")-Request.form("qty")

sql =
sSQL="Update spares SET spares.location='"&request("location")&_
"',spares.machine='"&request("machine")&_
"',spares.part_desc='"&request("part_desc")&_
"',spares.part_number='"&request("part_number")&_
"',spares.qty='(" & qty & ") "&_
"',spares.min_qty='"&request("min_qty")&_
"',spares.updated_by='"&session("name")&"' WHERE(spares.id)=" & form_id

400 Bad Request
I am trying asp.net for the very first time. When i try to work on an
example in a book, it says to create a project for (asp.net web application)

Location: http://localhost/aspexample1

I get error 400 bad request.

IIS server is running.

BAD REQUEST
Classic ASP, WIN2000, IE6.0
Error:
400 BAD REQUEST

The problem is ramdom

Url Request
I am developing site in asp where I need to call a url at every interval. Is there a way to automate this. I want to call the url every 15 or 30 mins.Cureently I have written a asp script tp call it using

Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.Open "GET",URL
objWinHttp.Send ' Send it.
strResponse3 = objWinHttp.ResponseText ' Get the response string from the object.

But it is not schedule..I can call it only when I rum the asp script. So is there any way I can schedule this url call for every 15/30 minutes.
Also forgot to mention : the site does not have that much traffic that I can add it in index page...there may be a user visiting the site in 5 hours time or within next 5 mins or for next 2 days there may be no visitor.

400 Bad Request
I am trying asp.net for the very first time. When i try to work on an
example in a book, it says to create a project for (asp.net web application)

Location: http://localhost/aspexample1

I get error 400 bad request.

IIS server is running.Please help me resolve this?

'request'
I have a form which shows all Records from a database
eg.
select * from sometable

the user inputs criteria in a form on the sam page and submits it.
i need to see if the form has been submited. and the way to do it is to
see if i have 'Request.form(somefield)' and then refrase the sql into
something like

select *from table where something=this and somethingelse=this
my problem is that i have to check every form field to see if it has been
set(not empty).Is there a way to see this without checking every form field?

Using Request
Can we execute an Access Request with ASP? If Yes how can we do that?

Request
I created a ASP which has a form as well. The form has a list box.On the click of the submit button I wanted to just display the contents selected from the list box.

When in the VB script part I say dataString = Request("Data_List"), (where Data_List is the list box id) it gives me an error message saying "Object Required. Request"

I tried it with the text box also. It gave me the same message.

Request.QS
I just want a person not to see a page if they have not come from paypal. Whats wrong with this code?Code:

<%
if(Request.QueryString("http://www.paypal.com") != "") then
Response.Redirect("index.asp")
end if
%>

Request Is Nothing
I have use many request already but this time i really don't know how. Here is my problem, I use Request("var1") to request the form that i have submit it and it always nothing. but when I use Request.form to show all, it appear all include that variable too. And the web server is IIS 6.0 with windows 2003.

Request.querystring
Trying to test if Querystring is empty. then display content based on that. Currently trying: Code:

<% if Request.QueryString("variable")="" then
response.write ("hello") End If %>

Basically I'm looking for a way to display certain content only on the main page when no variable has been set.


Copyright © 2005-08 www.BigResource.com, All rights reserved