2020-01-28, 05:03 PM
I've tried to play around with the member referral link:
http://example.com/member.php?action=reg...referrer=1
The non-mybb pages are just simple html. What I'm attempting to do is send someone to:
http://example.com/?referrer=1
They browse to any page they like within site non-mybb and mybb pages and "referrer=1" is remembered across site. If and when the go through registration process during session referrer will show as "admin" or whomever referrer was.
I tried this on example.com homepage:
<?php
// Start the session
session_start();
?>
<?php
// Set session variables
if (empty($_GET)) {
$_SESSION['mode'] = "referrer";
}else{
$_SESSION['mode'] = $_GET['mode'];
}
?>
Tried to insert 2nd portion (without php brackets) within mybb index.php, global.php, header, etc. to no avail during registration process.
Am I on right track with above or just wildly off and if so what should I be doing? I chose php because that is the guts of mybb, but would this be better suited for a javascript snippet? That seems like it would open up a whole other host of problems for a novice. It seems like a simple idea to carry over a cookie or variable in browser between different portions of site.
Any help greatly appreciated.
http://example.com/member.php?action=reg...referrer=1
The non-mybb pages are just simple html. What I'm attempting to do is send someone to:
http://example.com/?referrer=1
They browse to any page they like within site non-mybb and mybb pages and "referrer=1" is remembered across site. If and when the go through registration process during session referrer will show as "admin" or whomever referrer was.
I tried this on example.com homepage:
<?php
// Start the session
session_start();
?>
<?php
// Set session variables
if (empty($_GET)) {
$_SESSION['mode'] = "referrer";
}else{
$_SESSION['mode'] = $_GET['mode'];
}
?>
Tried to insert 2nd portion (without php brackets) within mybb index.php, global.php, header, etc. to no avail during registration process.
Am I on right track with above or just wildly off and if so what should I be doing? I chose php because that is the guts of mybb, but would this be better suited for a javascript snippet? That seems like it would open up a whole other host of problems for a novice. It seems like a simple idea to carry over a cookie or variable in browser between different portions of site.
Any help greatly appreciated.