arkad
08-27-2009, 06:35 PM
hello world,
im attempting to create a script that stores a variable depending on the user logged in (so if user sally is logged in, sally is stored in a variable)
and then swaps that variable with one inside an outgoing link when it is clicked
so if sally clicks somelink.com/?ref=#USERNAME#
the link becomes somelink.com/?ref=sally
how are the usernames stored to start? cookies, mysql, etc?
arkad
08-27-2009, 06:44 PM
im not sure yet how to store the username variable in the first place, im trying to find that out right now...
arkad
08-27-2009, 06:46 PM
do i need to use mySQL? what i mean is theres no way to have php remember whos logged in after the user changes pages unless the username is stored in the database when they first log in? so then php can grab the variable from the database when they click on links?
you can use cookies http://www.w3schools.com/PHP/php_cookies.asp
arkad
08-28-2009, 12:00 AM
i appreciate that link and the info.
ill be doing this inside joomla. so some how i need to edit the built in login module to store the cookie so i can grab it from my link script.
joomla should already store cookies. you have a link? i can get you the cookie name if you dont know how to.
arkad
08-28-2009, 11:37 AM
try http://awakedesignstudios.com/ its just a template im using
if joomla stores this cookie of the username, do i need to attach it to a variable, or just call it from php?
how do i get the cookie name?