I am creating a webstore. I am using PHP sessions to navigate to the next page.
what the program should do is: when I click on a specific image, then the sessions variables should be assigned accordingly based upon the image clicked, but the problem is all session variables are assigning without clicking.
This is my code:
<div class="col-sm-3 col-xs-6" style="text-align:center">
<a href="list.php" onclick="<?php $_SESSION['x'] = 'clothing'; $_SESSION['v1'] = 'shirts';?>" ><img class="img-responsive img-circle " src="image/0.jpg" />Clothing</a>
</div>
<div class="col-sm-3 col-xs-6" style="text-align:center" >
<a href="list.php" onclick=" <?php $_SESSION['v1'] = 'mobiles'; ?>" ><img class="img-responsive img-circle " src="image/5.jpg" />mobiles</a>
</div>
So without clicking, mobile session variables were assigned to "mobiles" as it is the last declared...