server-variables

How can you “footprint” a specific computer behind a firewall using HttpContext?

ぐ巨炮叔叔 提交于 2019-12-06 03:56:45
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. So, because of the firewall their IP address is the same and all of their ServerVariables (browseragent, logonuser) are the same, I need to find something else that will tell different machines apart. Since the site is secured with formsauthentication, Windows Integrated Authentication must be turned off (otherwise i'd have access to different Logon

Accessing $_SERVER variables from command line

雨燕双飞 提交于 2019-12-02 10:39:55
问题 How do I access $_SERVER variables I've set from the command line in PHP? When I try to call a PHP method I've created I get the following error, which shows that all the $_SERVER variables are only defined when one calls my app via its URLs, i.e., webserver: ERROR - Undefined index: MY_VAR /www/html/some_file.php ERROR - Undefined index: MY_OTHER_VAR /www/html/some_file.php To be more specific I'm using Codeigniter, but don't believe that is the issue. Thoughts? 回答1: If you're setting the

Accessing $_SERVER variables from command line

一曲冷凌霜 提交于 2019-12-02 05:46:45
How do I access $_SERVER variables I've set from the command line in PHP? When I try to call a PHP method I've created I get the following error, which shows that all the $_SERVER variables are only defined when one calls my app via its URLs, i.e., webserver: ERROR - Undefined index: MY_VAR /www/html/some_file.php ERROR - Undefined index: MY_OTHER_VAR /www/html/some_file.php To be more specific I'm using Codeigniter , but don't believe that is the issue. Thoughts? Joel L If you're setting the server variables in your web server config, then they won't be present when you access PHP via the

How can I use Basic HTTP Authentication in PHP?

假装没事ソ 提交于 2019-11-30 08:40:06
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 login-dialog. The server is running PHP 5.3.3 and I have tried with Google Chrome and Internet Explorer. Here is the simple example that I used: <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="Jonas Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'User pressed Cancel'; exit; } else { echo "<p>Hello {$_SERVER['PHP

How to access ServerVariables in AspnetCore 1.0

送分小仙女□ 提交于 2019-11-29 14:37:17
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, this.HttpContext.Features does not contain IServerVariablesFeature . Okay, I am not going to directly answer your question. I am going to try and throw some light on why this server variable is not a problem anymore. "HTTP_ACCEPT_LANGUAGE" is a server variable that IIS & .NET used to facilitate on ASP.NET framework to communicate content language with the

How can I use Basic HTTP Authentication in PHP?

一个人想着一个人 提交于 2019-11-29 11:42:47
问题 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 login-dialog. The server is running PHP 5.3.3 and I have tried with Google Chrome and Internet Explorer. Here is the simple example that I used: <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="Jonas Realm"'); header

How to access ServerVariables in AspnetCore 1.0

天涯浪子 提交于 2019-11-28 08:17:56
问题 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, this.HttpContext.Features does not contain IServerVariablesFeature . 回答1: Okay, I am not going to directly answer your question. I am going to try and throw some light on why this server variable is not a problem anymore. "HTTP_ACCEPT_LANGUAGE" is a server

HTTP Auth via PHP - PHP_AUTH_USER not set?

不羁岁月 提交于 2019-11-27 22:26:38
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: <?php if(!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'Text to send if user hits Cancel button'; exit; } else { echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; } ?> However, my browser always ask for a username and password but never outputs anything until i cancel. Therefore i think that $_SERVER['PHP

Difference between REMOTE_HOST and REMOTE_ADDR

谁都会走 提交于 2019-11-27 21:01:15
What is the difference between these two variables? REMOTE_HOST and REMOTE_ADDR . Ruel REMOTE_HOST pertains to the hostname of the client (i.e. the computer making the request). REMOTE_ADDR refers to the IP address of the client. There would be times when the hostname is unresolvable so the REMOTE_HOST will return the REMOTE_ADDR or the IP address instead. 1. $_SERVER['REMOTE_ADDR'] - This contains the real IP address of the client. That is the most reliable value you can find from the user. 2. $_SERVER['REMOTE_HOST'] - This will fetch the Host name from which the user is viewing the current

Difference between REMOTE_HOST and REMOTE_ADDR

亡梦爱人 提交于 2019-11-26 22:59:53
问题 What is the difference between these two variables? REMOTE_HOST and REMOTE_ADDR . 回答1: REMOTE_HOST pertains to the hostname of the client (i.e. the computer making the request). REMOTE_ADDR refers to the IP address of the client. There would be times when the hostname is unresolvable so the REMOTE_HOST will return the REMOTE_ADDR or the IP address instead. 回答2: 1. $_SERVER['REMOTE_ADDR'] - This contains the real IP address of the client. That is the most reliable value you can find from the