AnotherQuestion Posted August 30, 2009 Share Posted August 30, 2009 I would like to write s session var when a user clicks on a link.... Something like <a href="Invoice.php?DocumentId=<?php echo $row_RsInv['Document']; ?>"> <?php echo $row_RsInv['Document']; ?><?php $_SESSION['DocumentId1'] = $row_RsInv['Document']?> </a> but the above doesnt work. Any Ideas Link to comment https://forums.phpfreaks.com/topic/172503-onclick-thingy/ Share on other sites More sharing options...
RussellReal Posted August 30, 2009 Share Posted August 30, 2009 because once the php interpreter exits you can no longer use php.. so when the user actually sees the link.. it is already too late, you CAN however create an AJAX function to connect to a PHP file on your server than that php script sets the session var.. google AJAX Link to comment https://forums.phpfreaks.com/topic/172503-onclick-thingy/#findComment-909403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.