Jump to content

Recommended Posts

hi world, im new to php so bare with me.  a site im developing requires the ability to pass a variable to a link when its clicked.  what i mean by this is when a link is clicked, php grabs a variable and sticks it in the link, for tracking which user logged into my site clicked the link.

Link to comment
https://forums.phpfreaks.com/topic/172159-passing-variable-to-outgoing-link/
Share on other sites

so $_SESSION would be the variable thats storing the username? or username storing the variable, and $_SESSION is inputting it into the link?  im new to this php world....somehow i need to store a variable based on the user that is logged in, and pass the user variable into the link when its clicked...so if

print '<a href="http://domain/page.php?user=' . $_SESSION['username'] . '">click</a>';

puts the username into the link, how would i store the user variable in the first place?

so use a form?  doesnt that mean the very next page has to be the link one?  if im going to use the username var on different pages, will POST remember?  someone on another forum suggested i use cookies to store the username.  im using this in joomla, so i think i have the edit the built in login module to track the username coookie somehow, not sure how yet though.  do u know anything about customizing joomla and its extensions?

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.