http-referer

php/html - http_referer

瘦欲@ 提交于 2019-12-01 18:08:21
I am creating a website and on one particular page, am wanting to send the user back to the previous page. I am fairly new to PHP/HTML and have been using some existing code for ideas and help. The existing code uses the following method: if (! empty($HTTP_REFERER)) { header("Location: $HTTP_REFERER"); } else { header("Location: $CFG->wwwroot"); } However, when I use this code the HTTP_referer is always treated as empty and the user redirected to the root page. Any obvious flaws in this code? You need to use: $_SERVER['HTTP_REFERER'] Don't rely on the HTTP Referrer being a valid or even non

Get HTTP Referrer on Redirection

馋奶兔 提交于 2019-12-01 17:13:49
How can you get the HTTP Referrer when redirected from another website, not when they click on a link since it would work for $_SERVER['HTTP_REFERER'] , but it doesn't work when a user has been redirected a website and the referrer would be empty. What will be the method to get the referrer? How can you get the HTTP Referrer when redirected from another website You can't. If the redirection takes place under your control, you can add the original referer as a parameter, but if the external redirector doesn't do that, you have no way to get hold of the information. An example of how I did it.

php/html - http_referer

倖福魔咒の 提交于 2019-12-01 17:06:51
问题 I am creating a website and on one particular page, am wanting to send the user back to the previous page. I am fairly new to PHP/HTML and have been using some existing code for ideas and help. The existing code uses the following method: if (! empty($HTTP_REFERER)) { header("Location: $HTTP_REFERER"); } else { header("Location: $CFG->wwwroot"); } However, when I use this code the HTTP_referer is always treated as empty and the user redirected to the root page. Any obvious flaws in this code?

Laravel 5.4 get Referer

拟墨画扇 提交于 2019-12-01 15:33:59
I'm trying to get the Referer of my users. Like if they come from facebook, youtube, google or anything else. Now I've tried something like that: $referrer = $this->request->headers->get('referer'); $url = $referrer ? $this->to($referrer) : $this->getPreviousUrlFromSession(); return $url ?: $this->to('/'); // returns: Method referer does not exist. This: return $_SERVER["HTTP_REFERER"] // returns Undefined index: HTTP_REFERER that: session_start(); if ( !isset( $_SESSION["origURL"] ) ) $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"]; // returns Undefined index: HTTP_REFERER But nothing worked

Deny referrals from all domains except one

北城余情 提交于 2019-12-01 11:25:26
Is it possible to accept traffic from only one domain, ideally using a .htaccess file? I want my site to only be accessible via a link on another site I have. I know how to block one referring domain, but not all domains RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} otherdomain\.com [NC] RewriteRule .* - [F] this is my full rewrite code: RewriteEngine On RewriteBase / RewriteCond %{HTTP_REFERER} . RewriteCond %{HTTP_REFERER} !domain\.co.uk [NC] RewriteRule .? - [F] # The Friendly URLs part RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

Get URL of Referer page in ASP.NET

烂漫一生 提交于 2019-12-01 09:04:47
I am working on an ASP.NET project and currently struck in something. Basically, I have three different levels of users 1. Admin 2. DMV 3. Caller All the users have their respective directories, and can access the resources in those according to their rights. When someone wants to sign-in to the application, he has to use the same login.aspx page that is present in the root directory, and once logged-in, he is redirected to the home page of his respective folder, based on his privilege. In my application, sometimes when a session closes unwillingly, the user is redirected to the login page, or

Deny referrals from all domains except one

走远了吗. 提交于 2019-12-01 07:34:58
问题 Is it possible to accept traffic from only one domain, ideally using a .htaccess file? I want my site to only be accessible via a link on another site I have. I know how to block one referring domain, but not all domains RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} otherdomain\.com [NC] RewriteRule .* - [F] this is my full rewrite code: RewriteEngine On RewriteBase / RewriteCond %{HTTP_REFERER} . RewriteCond %{HTTP_REFERER} !domain\.co.uk [NC] RewriteRule .? - [F] #

Get URL of Referer page in ASP.NET

主宰稳场 提交于 2019-12-01 06:14:05
问题 I am working on an ASP.NET project and currently struck in something. Basically, I have three different levels of users 1. Admin 2. DMV 3. Caller All the users have their respective directories, and can access the resources in those according to their rights. When someone wants to sign-in to the application, he has to use the same login.aspx page that is present in the root directory, and once logged-in, he is redirected to the home page of his respective folder, based on his privilege. In my

Url fragment and Referer header

独自空忆成欢 提交于 2019-12-01 03:21:00
Imagine you are on a page whose URL has a fragment (the part after the # ), and click a link to go to another page. Most browsers will send the URL of the original page to the server in the Referer header. What I want to know is whether or not the URL fragment will be included in this or not. I have seen various behaviors in the wild so this might be browser-specific. Does anyone know which browsers do what? And what does the HTTP spec say on this? The spec says that Referer can't include a fragment identifier (per ABNF). See RFC 2616, Section 14.36 . I saw the same behavior in IE today. I am

Get referring URL for Flask request

☆樱花仙子☆ 提交于 2019-11-30 18:57:41
When a user visits our site and signs up, how can I capture which website they came from? Be it search, a PR website, etc. I don't care what page from our site they visited, I just want to know which marketing efforts are giving us the most signups. I know Google Analytics can probably do this but I'd like to have something internal for reference as well. Selcuk request.referrer contains the URL the request came from, although it might not be sent by the client for various reasons. The attribute takes its value from the Referer (not a typo!) header: referrer = request.headers.get("Referer")