Get original URL referer with PHP?
Store it either in a cookie (if it's acceptable for your situation), or in a session variable.
session_start();
if ( !isset( $_SESSION["origURL"] ) )
$_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];
Get original URL referer with the condition
I found my problem. Maybe this solution will help anyone in the future.
function getRefererPage3( $form_tag ){
if (strpos($_SESSION['LandingPage'], 'partner') !== false) {
if ( $form_tag['name'] == 'referer-page3 ) {
$form_tag['values'][] = $_SESSION['LandingPage'];
}
}
return $form_tag;
}
if ( !is_admin() ) {
add_filter( 'wpcf7_form_tag', 'getRefererPage3' );
}
PHP: How to get referrer URL?
$_SERVER['HTTP_REFERER']
will give you the referrer page's URL if there exists any. If users use a bookmark or directly visit your site by manually typing in the URL, http_referer will be empty. Also if the users are posting to your page programatically (CURL) then they're not obliged to set the http_referer as well. You're missing all _
, is that a typo?
Get Original Referrer URL from Google Search with PHP?
Google removes the search query for HTTPS connections and logged users so the only way to know the search query is using Google Analytics
When you search from https://www.google.com, websites you visit from our organic search listings will still know that you came from Google, but won't receive information about each individual query.
http://googleblog.blogspot.com.es/2011/10/making-search-more-secure.html
http://analytics.blogspot.com.es/2011/10/making-search-more-secure-accessing.html
Get the action name of referer url (previous url) in cakephp
To get the referer full base url, we use $this->referer()
, if you parse Router::parse($this->referer());
we get an empty array
but to restrict referring urls to local server, you've to use pass additional param like below
$refer_url = $this->referer('/', true); // you get like "/project/users/login"
Now if you parse the above returned value$parse_url_params = Router::parse($refer_url);
you'll get the details of Controller, Action & Plugin
Here are the details:
Array (
[plugin] =>
[controller] => users
[action] => login
[named] => Array ()
[pass] => Array ( )
)
Related Topics
Laravel - Eloquent or Fluent Random Row
How to Create Multilingual Translated Routes in Laravel
Login Without Https, How to Secure
Download Files in Laravel Using Response::Download
Convert Latin1 Characters on a Utf8 Table into Utf8
How to Find the First and Last Date in a Month Using PHP
PHP Fatal Error: Call to Undefined Function Json_Decode()
Using Default Arguments in a Function
Passing an Array as Arguments, Not an Array, in PHP
Checking to See If One Array'S Elements Are in Another Array in PHP
Rebase Array Keys After Unsetting Elements
Codeigniter: Passing Data from Controller to View
Retrieving Multiple Result Sets With Stored Procedure in PHP/MySQLi
Converting a Number (1, 2, 3) to a String (One, Two, Three) in PHP