Jump to content

Archived

This topic is now archived and is closed to further replies.

webcutie

Cookies or Sessions or something like that?!?

Recommended Posts

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]



Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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

Share this post


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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.