I'm currently trying to make specific adblocks. My code's below.
<?php
session_start();
$isLayout = 0;
if(isset($_REQUEST['layout']) && ($_REQUEST['layout'] == 'source1')){
$isLayout = 1;
$_SESSION["isLayout"] = 1; }
So currently, this is reading the URL parameters and if ?layout=source1 is appended to the end of the URL, specific changes will be shown on the website. My code to make that happen is below.
<?php
if($isLayout == 0){
echo 'nothing';
}else{
echo 'magic that's only to be seen if users come to website from source 1'
}
?>
So currently, I got the code to work on the first page visited by the user. However, when that user visits other pages of the website even if they come from source1, the layout goes back to the default. I want to make sure that they site's changes are consistent through the users entire session on the website and not just the first page.
Aucun commentaire:
Enregistrer un commentaire