adv Posted February 9, 2008 Share Posted February 9, 2008 hello i have a problem ... i have some input text <input name="about" value="" type="text" > <input name="about1" value="" type="text" > and in that file i`m trying to store the value of the text with cookie i`ve tried <?php $about=$_POST['about']; $about1=$_POST['about1']; if (!empty($about)&&!empty($about1)){ setcookie("abb1",$about,time()+3600); setcookie("abb2",$about1,time()+3600); } ?> and in another page i tried to request that cookie like this <?php $info1=$_COOKIE['abb1']; $info2=$_COOKIE['abb2']; ?> i tried to send the cookie to an email <?php $message="info1:$info1\ninfo2:$info2\n"; mail("[email protected]","test",$message); but sometimes it doesn`t work it sends the cookie empty info: info1: and i have another question does $_SESSION and $_COOKIE conflict?? Link to comment https://forums.phpfreaks.com/topic/90262-solved-cookie-and-session-question/ Share on other sites More sharing options...
adv Posted February 9, 2008 Author Share Posted February 9, 2008 ups i`m so sorry about the double post but my connection has some problems ( can u please delete the other post :| Link to comment https://forums.phpfreaks.com/topic/90262-solved-cookie-and-session-question/#findComment-462749 Share on other sites More sharing options...
revraz Posted February 9, 2008 Share Posted February 9, 2008 You need to make sure the two pages are coming from the same domain. IE, www.mydomain.com is not the same as mydomain.com You can use both $_SESSION and $_COOKIE, they are seperate variables. Link to comment https://forums.phpfreaks.com/topic/90262-solved-cookie-and-session-question/#findComment-462810 Share on other sites More sharing options...
adv Posted February 9, 2008 Author Share Posted February 9, 2008 yes i have both files in the same folder .. :| i`ve made a test but it works good ..but on other people it doesn`t .. i`m confused What could be the most often problems that can apear? Link to comment https://forums.phpfreaks.com/topic/90262-solved-cookie-and-session-question/#findComment-462870 Share on other sites More sharing options...
revraz Posted February 10, 2008 Share Posted February 10, 2008 Them blocking cookies or using a different URL Link to comment https://forums.phpfreaks.com/topic/90262-solved-cookie-and-session-question/#findComment-462958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.