Post by mano.wong » Thu Aug 15, 2019 9:04 pm

dear all,

i am a beginner. I want to capture URL parameter to cookie

e.g.
http://eshop.domain.com?RID=C6-773&Click_ID=102eb2f

code shown below: "abc.php"

<?php
$RPage = $_GET['RPage'];
$RID = $_COOKIE["RID"];
if (!isset($_COOKIE['RID'])){
setcookie('RID',addslashes($_GET['RID']),time()+2*60*60);
}
$Click_ID = $_COOKIE['Click_ID'];
if (!isset($_COOKIE['Click_ID'])){
setcookie('Click_ID',addslashes($_GET['Click_ID']),time()+2*60*60);
}
$RPath = $_SERVER['HTTP_HOST']."/".$RPage;
if($RPage)
header("Location: ".$RPath);
else
header("Location: ".$_SERVER['HTTP_HOST']);
?>

1.) where to embed the codes? login.php or startup.php or ... ?
2.) is there any way to do this (simple)?

thx a lot

Newbie

Posts

Joined
Mon Feb 06, 2017 11:04 am
Who is online

Users browsing this forum: OSWorX and 33 guests