Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-27-2009, 06:35 PM   PM User | #1
arkad
New Coder

 
Join Date: Aug 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
arkad is an unknown quantity at this point
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
arkad is offline   Reply With Quote
Old 08-27-2009, 06:39 PM   PM User | #2
seco
Regular Coder

 
seco's Avatar
 
Join Date: Nov 2008
Location: Oregon
Posts: 682
Thanks: 5
Thanked 79 Times in 77 Posts
seco has a little shameless behaviour in the past
how are the usernames stored to start? cookies, mysql, etc?
seco is offline   Reply With Quote
Old 08-27-2009, 06:44 PM   PM User | #3
arkad
New Coder

 
Join Date: Aug 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
arkad is an unknown quantity at this point
im not sure yet how to store the username variable in the first place, im trying to find that out right now...
arkad is offline   Reply With Quote
Old 08-27-2009, 06:46 PM   PM User | #4
arkad
New Coder

 
Join Date: Aug 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
arkad is an unknown quantity at this point
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?
arkad is offline   Reply With Quote
Old 08-27-2009, 06:53 PM   PM User | #5
seco
Regular Coder

 
seco's Avatar
 
Join Date: Nov 2008
Location: Oregon
Posts: 682
Thanks: 5
Thanked 79 Times in 77 Posts
seco has a little shameless behaviour in the past
you can use cookies http://www.w3schools.com/PHP/php_cookies.asp
seco is offline   Reply With Quote
Old 08-28-2009, 12:00 AM   PM User | #6
arkad
New Coder

 
Join Date: Aug 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
arkad is an unknown quantity at this point
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.
arkad is offline   Reply With Quote
Old 08-28-2009, 12:11 AM   PM User | #7
seco
Regular Coder

 
seco's Avatar
 
Join Date: Nov 2008
Location: Oregon
Posts: 682
Thanks: 5
Thanked 79 Times in 77 Posts
seco has a little shameless behaviour in the past
joomla should already store cookies. you have a link? i can get you the cookie name if you dont know how to.
seco is offline   Reply With Quote
Old 08-28-2009, 11:37 AM   PM User | #8
arkad
New Coder

 
Join Date: Aug 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
arkad is an unknown quantity at this point
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..
arkad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:31 AM.


Advertisement
Log in to turn off these ads.