Jump to content

Passing variable to outgoing link


awakedesignstudios

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.