Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.