webcutie Posted September 1, 2006 Share Posted September 1, 2006 Ok.... Well I'm new to the whole php thing.... so bare with me! I am going to be building an affiliate page and I need to make a place on the front page (a form) where I can cookie the affiliate code in.... so the affiliate code is placed on the other pages for the promotional material. I keeping hearing that it is so simple but I'm pretty lost. ??? If someone could help me, or send me a tutorial (has to be in simple terms)... That would be SOooooooo much help! [b]REMOVED CONTACT INFO[/b] Quote Link to comment https://forums.phpfreaks.com/topic/19389-cookies-or-sessions-or-something-like-that/ Share on other sites More sharing options...
.josh Posted September 1, 2006 Share Posted September 1, 2006 well, which do you want, a cookie or a session? Are you wanting the information to be stored only as long as the user is at the website? then you should go the session route. do you wish for the user to be able to go to some other website, close the browser, turn off the computer and come back later to your site, and the information is still there? go the cookie route. or actually, storing the info in a database or flatfile would be better, as you can't be positive the user's computer will allow cookies in the first place.. so yeah, be a little bit more specific in your needs. How long does this data need to persist? Quote Link to comment https://forums.phpfreaks.com/topic/19389-cookies-or-sessions-or-something-like-that/#findComment-84141 Share on other sites More sharing options...
webcutie Posted September 1, 2006 Author Share Posted September 1, 2006 Well I would say cookies......Make the cookie stay for a few days but I need the option to be able to remove the cookie also..... so if they accidently type in the wrong affiliate code....they can delete it......Hope you can help me now :) Quote Link to comment https://forums.phpfreaks.com/topic/19389-cookies-or-sessions-or-something-like-that/#findComment-84147 Share on other sites More sharing options...
ober Posted September 1, 2006 Share Posted September 1, 2006 You can remove cookies via 2 methods: using a short timeout, or setting the cookie timeout value to some time in the past at some point during the traversal of your site.All this and more is in the manual... which can be found in my signature. Go there, and do a search for 'setcookie'.eh, I'll just give you the link: http://www.php.net/manual/en/function.setcookie.php Quote Link to comment https://forums.phpfreaks.com/topic/19389-cookies-or-sessions-or-something-like-that/#findComment-84150 Share on other sites More sharing options...
webcutie Posted September 1, 2006 Author Share Posted September 1, 2006 Thanks Ober!Any other tutorials that explain a little bit more in detail? I'm a newbie to the whole thing...... :'( Quote Link to comment https://forums.phpfreaks.com/topic/19389-cookies-or-sessions-or-something-like-that/#findComment-84159 Share on other sites More sharing options...
webcutie Posted September 1, 2006 Author Share Posted September 1, 2006 PLEASE :) Quote Link to comment https://forums.phpfreaks.com/topic/19389-cookies-or-sessions-or-something-like-that/#findComment-84169 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.