Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    storing variable and putting into link when clicked

    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

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    how are the usernames stored to start? cookies, mysql, etc?

  • #3
    New Coder
    Join Date
    Aug 2009
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im not sure yet how to store the username variable in the first place, im trying to find that out right now...

  • #4
    New Coder
    Join Date
    Aug 2009
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #5
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts

  • #6
    New Coder
    Join Date
    Aug 2009
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks

    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.

  • #7
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    joomla should already store cookies. you have a link? i can get you the cookie name if you dont know how to.

  • #8
    New Coder
    Join Date
    Aug 2009
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i have several joomla sites

    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?
    Last edited by arkad; 08-28-2009 at 11:42 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •