referrer

Getting the IP address of server in ASP.NET?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 03:56:40
How do I get the IP address of the server that calls my ASP.NET page? I have seen stuff about a Response object, but am very new at c#. Thanks a ton. TStamper This should work: //this gets the ip address of the server pc public string GetIPAddress() { IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName()); // `Dns.Resolve()` method is deprecated. IPAddress ipAddress = ipHostInfo.AddressList[0]; return ipAddress.ToString(); } http://wec-library.blogspot.com/2008/03/gets-ip-address-of-server-pc-using-c.html OR //while this gets the ip address of the visitor making the call HttpContext

JavaScript window.location does not set referer in the request header

♀尐吖头ヾ 提交于 2019-11-27 03:34:58
I understand relying on Referer in the request header is not right. But my question is, why IE does not set Referer to the Request Header if I use window.location ? Any thoughts or fixes? This does not set Referer in the Request header : function load1() { window.location = "https://" + serverURL + "/path/folder/page.aspx"; } <a href="javascript:load1()">Link 1</a> While this sets : <a href="https://hardcode.server.url/path/folder/page.aspx">Link 1</a> Julien Kronegg Your post title shows that you want to change the current page programmatically using JavaScript but still having the HTTP

Stop link from sending referrer to destination

為{幸葍}努か 提交于 2019-11-26 22:20:30
问题 I have a page where I don't want the outbound links to send a referrer so the destination site doesn't know where they came from. I'm guessing this isn't possible but I just want to make sure there weren't any hidden javascript magic that could do it and that would work with some (if not most) browsers. Maybe some clever HTTP status code redirecting kung-fu? Something like this would be perfect <a href="example.com" send_referrer="false">link</a> 回答1: I was looking for just the same thing,

What is the most reliable way to hide / spoof the referrer in JavaScript?

可紊 提交于 2019-11-26 21:33:09
Normally, the referrer is traceable through: JavaScript's document.referrer The request headers, e.g. PHP's $_SERVER['HTTP_REFERER'] I have set up a Codepad demo which shows these properties, for testing purposes. Requirements: The original referrer should effectively be hidden, at least for all mouse events. Cross-browser support (at least Chrome and Firefox). Stand-alone, without any external content (plugins, libraries, redirection pages, ...). No side-effects: Links should not be rewritten, history entries should be preserved . The solution will be used to hide the referrer when following

Inspect the referrer in PHP

我只是一个虾纸丫 提交于 2019-11-26 20:54:20
问题 Is it possible to check who is entering your website in PHP. I have a web application ( written in PHP) that should only allow users entering from some particular websites. Is it possible to get the referral websites by examining the _Request object? If yes, how? 回答1: Yes, but keep in mind some proxies and other things strip this information out, and it can be easily forged. So never rely on it. For example, don't think your web app is secure from CSRF because you check the referrer to match

Checking the referrer

巧了我就是萌 提交于 2019-11-26 17:57:42
问题 I'm using this to check if someone came from Reddit, however it doesn't work. var ref = document.referrer; if(ref.match("/http://(www.)?reddit.com(/)?(.*)?/gi"){ alert('You came from Reddit'); } else { alert('No you didn\'t'); } Suggestions on the regular expression are most welcome too. 回答1: Try this: if (ref.match(/^https?:\/\/([^\/]+\.)?reddit\.com(\/|$)/i)) { alert("Came from reddit"); } The regexp: /^ # ensure start of string http # match 'http' s? # 's' if it exists is okay :\/\/ #

How do I get the referrer URL in an ASP.NET MVC action?

走远了吗. 提交于 2019-11-26 16:31:35
How do I get the referrer URL in an ASP.NET MVC action? I am trying to redirect back to the page before you called an action. You can use Request.UrlReferrer to get the referring URL as well if you don't like accessing the Request.ServerVariables dictionary directly. Daniel Elliott Request.ServerVariables["http_referer"] Should do. Navish Rampal You can use this filterContext.RequestContext.HttpContext.Request.UrlReferrer.AbsolutePath To correct use reffer url you should pass it to viewModel, try so: public interface IReferrer { String Referrer { get; set; } } ... public static MvcHtmlString

Get the referrer, paid/natural and keywords for the current visitor with Google Analytics

别说谁变了你拦得住时间么 提交于 2019-11-26 15:58:24
问题 Is it possible to get the following information about the current visitor using Google Analytics API with JavaScript? Referrer site ('Source' in GA) Paid or natural ('Medium' in GA) Keyword First time/returning Number of visits If it's not possible with Google Analytics API is there any other easy way to do it (apart from parsing HTTP Referer, storing the visits statistics in DB etc.)? 回答1: If you're still using ga.js (the legacy version of Google Analytics tracking code), you can use the

jQuery check if Cookie exists, if not create it

此生再无相见时 提交于 2019-11-26 15:52:34
问题 I cannot get this code to work I must be missing something pretty simple. I am trying to check to see if a Cookie exists, if it does {do nothing} if it doesn't {create it}. I am testing the cookie by including an alert on a page. Basically I do not want the cookie to keep re-creating with a referral url, I am trying to grab only the FIRST referred URL. $(document).ready(function(){ if ($.cookie('bas_referral') == null ){ var ref = document.referrer.toLowerCase(); // set cookie var cookURL = $

How to get the previous url using PHP

走远了吗. 提交于 2019-11-26 15:36:56
问题 Suppose my site's url is given as hyperlink on some page on the internet; that page could be anything on internet - blog, orkut, yahoo, even stackoverflow etc, and someone clicks on it,and visited my site. So can we know, using php, the previous url from which the visitor came to my page? 回答1: Use the $_SERVER['HTTP_REFERER'] header, but bear in mind anybody can spoof it at anytime regardless of whether they clicked on a link. 回答2: $_SERVER['HTTP_REFERER'] is the answer 回答3: $_SERVER['HTTP