Forum Moderators: coopster

Message Too Old, No Replies

setcookie Help?

         

austinwagner

5:27 pm on Aug 8, 2008 (gmt 0)

10+ Year Member



I am new to coding. I am way better at designing than coding. But a project for a friend is pushing my limits! I need to learn how to embed a cookie at login with the users name on it. I am using Dreamweaver 8, and if anyone could give me some step by step directions, that would be great! Thanks!

I am using PHP5

ag_47

8:48 pm on Aug 8, 2008 (gmt 0)

10+ Year Member



Just check out PHP's manual for setcookie function. The only thing to note is that setcookie must be called before the HTML/DOCTYPE tag (i.e. before any output, like a header). Other than that is pretty straightforward.
bool setcookie( "name", "content", int_expire_time);
..
<html>
..