I want to have a regular link. If its clicked I want to add a session which is a variable on the page. So if the variable is 20 that in the next page I can just call it by typing. $_SESSION["variable"] = $variable; and typing $variable where I want it. How would I do that?
You could send the variable via GET inside the link, then on the page your linking to, set the session variable for it:
//page1 <a href="somepage.php?var=<?=$PHPVar?>">click here</a> //page2 $_session["var"] = $_GET["var"];