Questions tagged [server-variables]
87 questions
576
votes
11 answers
What is the difference between HTTP_HOST and SERVER_NAME in PHP?
What is the difference between $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME'] in PHP?
When would you consider using one over the other and why?

Emanuil Rusev
- 34,563
- 55
- 137
- 201
55
votes
4 answers
Difference between REMOTE_HOST and REMOTE_ADDR
What is the difference between these two variables?
REMOTE_HOST and REMOTE_ADDR.

hd.
- 17,596
- 46
- 115
- 165
22
votes
5 answers
How can I use Basic HTTP Authentication in PHP?
I'm trying to use Basic HTTP Authentication and followed the example on the PHP manual page. But it doesn't work for me. The variable $_SERVER['PHP_AUTH_USER'] doesn't seem to be set. When a user try to log in, the user is prompted whith a new…

Jonas
- 121,568
- 97
- 310
- 388
12
votes
2 answers
Mysql: What is the difference between "slow_query_log" vs "log_slow_queries"
If there is not any difference, why having two server parameters to achieve one behavior?

Uday
- 1,480
- 4
- 27
- 44
11
votes
2 answers
$_SERVER["SCRIPT_URL"]: when is it reliably present?
In my local environment (PHP 5.4.24 on Apache 2.2.26) $_SERVER["SCRIPT_URL"] is present, but I read around that this variable is not always present, even though I couldn't find exactly when it is and when it isn't.
I'd like to know what is required…

clami219
- 2,958
- 1
- 31
- 45
9
votes
2 answers
What does the utmscr or utmcct values mean in reference to the Http cookie Server variable?
What does the utmscr and/or utmcct values mean in reference to the Http cookie Server variable? Are they acronyms or short for something?
We are getting Elmah errors with the title "System.Web.HttpException: Unable to validate data." In each Elmah…

James Lawruk
- 30,112
- 19
- 130
- 137
9
votes
3 answers
HTTP Auth via PHP - PHP_AUTH_USER not set?
I tried to implement a small authentication via http and copied this bit of code from the net to check whether this will work properly:

Christian Ivicevic
- 10,071
- 7
- 39
- 74
6
votes
2 answers
How to access ServerVariables in AspnetCore 1.0
In exisiting .Net Web Site, Server Variables is accessed using
HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]
How to access the ServerVariables in AspnetCore 1.0 Web Application?
While debugging inside controller,…

Navaneeth
- 447
- 3
- 8
- 16
4
votes
2 answers
How should I store access token from a 3rd part api
Hi i am using meteorjs and a 3rd party api to create users on 3rd party's database.
I am getting access tokens with oauth2 and tokens have 2 hour expiry.
After getting the access token with an async function I use it with couple of different…

mcnk
- 1,690
- 3
- 20
- 29
4
votes
2 answers
HTTP_COOKIE IIS Server Variable expiring for unknown reason
Short Description: the IIS Server Variable "HTTP_COOKIE" is expiring in at a time that doesn't seem to be controlled by any timeout variable and I'd like to know what is causing it. I've tried modifying all of the timeout/expiry controlling values I…

Ieuan Stanley
- 1,248
- 8
- 20
4
votes
1 answer
Some Server Variables not accessible from OwinContext
In theory the OwinContext environment should have access to the request/response information as well as server variables, although for some reason from the OwinContext I can't access some of the custom server variables that are available from the…

Pierluc SS
- 3,138
- 7
- 31
- 44
3
votes
2 answers
How can you "footprint" a specific computer behind a firewall using HttpContext?
I have a need to be able to identify one system from another in ASP.Net using anything available in HttpContext. I've attempted to use many of the ServerVariables available, but often the systems are configured from a drive built off of an image.…

Joel Etherton
- 37,325
- 10
- 89
- 104
3
votes
1 answer
setting site-specific server variables in homestead.yaml
I am hoping I can set server variables for specific sites, in this case for a URL that is used for acceptance testing with Behat.
I can set this manually in nginx with e.g.:
fastcgi_param APP_ENV "acceptance";
However, I would like to know if…

Adamski
- 3,585
- 5
- 42
- 78
3
votes
7 answers
PHP - How to determine if request is coming from a specific file
I have fileA.php on SERVER_A and fileB.php on SERVER_B
fileB.php makes a curl request to fileA.php for it's contents
How can fileA.php determine that the request is coming specifically from fileB.php?
--
I was thinking about sending the…

Mickey
- 2,285
- 6
- 26
- 37
2
votes
1 answer
mod_rewrite & PHP; $_SERVER['REQUEST_URI'] vs. mod_rewrite
Quick one:
I'm curious if anyone knows of certain circumstances under which $_SERVER['REQUEST_URI'] would contain a different value than $_GET['_uri'], given the following .htaccess for the latter:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond…

Dan Lugg
- 20,192
- 19
- 110
- 174