Jump to content


Photo

Cookies or Sessions or something like that?!?


  • Please log in to reply
5 replies to this topic

#1 webcutie

webcutie
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationLas Vegas

Posted 01 September 2006 - 05:09 PM

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!

REMOVED CONTACT INFO





#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 01 September 2006 - 05:14 PM

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?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 webcutie

webcutie
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationLas Vegas

Posted 01 September 2006 - 05:21 PM

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 :)


#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 01 September 2006 - 05:29 PM

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/m...n.setcookie.php

Info: PHP Manual


#5 webcutie

webcutie
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationLas Vegas

Posted 01 September 2006 - 05:42 PM

Thanks Ober!
Any other tutorials that explain a little bit more in detail? I'm a newbie to the whole thing......
:'(

#6 webcutie

webcutie
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationLas Vegas

Posted 01 September 2006 - 06:06 PM

PLEASE :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users