473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

server variables question

I have a little snippet of code that looks like this:

strServer = Request.ServerVariables ("server_name")
If strServer = "localhost" then
The purpose of this code is to do one thing when I'm on my development
machine, and another when on production. This is valuabel as it has kept me
from having to change code when uploading from dev to prod.

It was working fine, as recently as two hours ago, and now it doesn't. I do
a response.write and it returns an empty string. I have no idea why, and I
certainly didn't change anything. Anyone have any idea why this could
happen?


Jul 19 '05 #1
4 2607
What is empty? strServer?

dim strserver
strServer = Request.ServerVariables ("server_name")
response.write strserver '<-- is this empty?

middletree wrote:
I have a little snippet of code that looks like this:

strServer = Request.ServerVariables ("server_name")
If strServer = "localhost" then
The purpose of this code is to do one thing when I'm on my development
machine, and another when on production. This is valuabel as it has kept me
from having to change code when uploading from dev to prod.

It was working fine, as recently as two hours ago, and now it doesn't. I do
a response.write and it returns an empty string. I have no idea why, and I
certainly didn't change anything. Anyone have any idea why this could
happen?


Jul 19 '05 #2
Yes, strServer is empty.

Specifically I do
response.write strServer &"test"
response.end

and get:

test
Also, it should be noted that although I show a space just before the
opening parenthesis, there's actually no space in my code. Just a typo here.
"Aaron" <a@1.net> wrote in message
news:Of*************@TK2MSFTNGP10.phx.gbl...
What is empty? strServer?

dim strserver
strServer = Request.ServerVariables ("server_name")
response.write strserver '<-- is this empty?

middletree wrote:
I have a little snippet of code that looks like this:

strServer = Request.ServerVariables ("server_name")
If strServer = "localhost" then
The purpose of this code is to do one thing when I'm on my development
machine, and another when on production. This is valuabel as it has kept me from having to change code when uploading from dev to prod.

It was working fine, as recently as two hours ago, and now it doesn't. I do a response.write and it returns an empty string. I have no idea why, and I certainly didn't change anything. Anyone have any idea why this could
happen?

Jul 19 '05 #3
Load up a page with this code and look at the results.
<%
Dim asdf4uaiskjdyf74
For each asdf4uaiskjdyf74 in Request.ServerVariables
Response.Write asdf4uaiskjdyf74 & " = " &
Request.ServerVariables(asdf4uaiskjdyf74)
Response.Write "<hr>"
Next
%>

Do you see all the server variable values, and does SERVER_NAME show up
okay?

Ray at home
"middletree" <mi********@htomail.com> wrote in message
news:Oz**************@TK2MSFTNGP09.phx.gbl...
Yes, strServer is empty.

Specifically I do
response.write strServer &"test"
response.end

and get:

test
Also, it should be noted that although I show a space just before the
opening parenthesis, there's actually no space in my code. Just a typo here.

"Aaron" <a@1.net> wrote in message
news:OfRx

Jul 19 '05 #4
> Dim asdf4uaiskjdyf74

WT_? Do you always make your variable names this cryptic, or only on
Thursdays? :-P
Jul 19 '05 #5

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

Similar topics

7
by: Harold | last post by:
Hi, I have a question in SQL Server 2K, I use SQL Profile to trace, and find Stored Procedure was auto recompiled, like this row in the trace: SP:Recompile 15 1680 76 2004-02-27 16:01:11.610 ...
6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
5
by: wolfing1 | last post by:
I'm working on a shopping cart page. In page A (checkout) the user enters their credit card information. On postback, if everything is correct, it sends the user to page B (confirmation). My...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
7
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize,...
11
by: Pirooz Javan | last post by:
Is there any way to deny a server variable to be run on a server such as LOCAL_ADDR? Thanks in advance. PJ
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.