I am trying to update a session value($_SESSION['adtitle']
) based on another session value($_SESSION['amount']
) with following code.It works for first time page load but then after it doesn't update the session accordingly though my main session $_SESSION['amount']
is updating
<?php
session_start();
if (isset($_SESSION['amount'])) {
if($_SESSION['amount']=2)
$_SESSION['adtitle']="Premium Listings for $2";
else if ($_SESSION['amount']=4)
{$_SESSION['adtitle']="Premium Blogs for $4";}
} else {
$_SESSION['adtitle']="Pls select your purchase type again!!";
}
header('Location: '. $_SERVER['HTTP_REFERER'] . '');
?>