Hi, every body. I just started working with PHP, and I met problem on setting cookie and session. In order to set cookie, I used setcookie("risfname",$refl[0][3],time()+3600); But it doesn't work. When I get cookie by the "risfname", only empty string I can see. What's the matter? and with session, I used session_start(), some warning message occured. and to set information on session, I wrote session_start(); session_register("risid"); $_SESSION["risid"]=$refl[0][1]; But also, I cann't get the data, only empty string. Pleas help me. Thank you.
Thank you, Columbian. so can you explain to me how to specify the save path? If you have sample code, then can you show me? Thank you. genette.
Thank you for your reply, xemiterx. But I can't get you. so which warning message copy to where, you mean? SOrry, I really don't understand. If you don't mind, more detail.. Thank you. genette.
you said when oyu use session_start() you get some warning message. he is referencing that warning message are you sure $refl[0][1] isn't empty?
Yes, I am sure that they have certain values. So, thank you for you url, but I still cann`t get any solution. Have you got any solution for me, Lordy? Thank you. genette
I set value on cookie: setcookie("risfname",$refl[0][3],time()+3600); but return value is False. And get it back : message($_COOKIE['risfname']); but shows "". So, what's the reason do you think, Lordy?
Hi, everybody. Thanks for your attention. So now I solved session problem. I can set session. BUt still not on cookie. Anybody have solution for set cookie? Expect advice on setting cookie. thank you. genette.
Hi! Your cookies will be work after reload your page only.. Look example: <? setcookie("mycook", "hello", time()+60*60); var_dump($_COOKIE["mycook"]); // or echo $_COOKIE["mycook"]; ?> Code (markup): you will receive empty string.. but this code will be work <? if(!isset($_COOKIE["mycook"])) { setcookie("mycook", "hello world", time()+60*60); echo "Cookie installed. Press F5 to view"; } else echo $_COOKIE["mycook"]; ?> Code (markup): Sorry for my english)