megafu Posted December 12, 2006 Share Posted December 12, 2006 Hi yall... well i am "new" with php so i am trying to build a very very simple login system where you dont even need pass, email or any. Just for leaning.the thin is im am willin go use cookies so i know that the user is/or not logged in. The code i am using is: [code] $userID= $_POST['userID']; $hour = time() + 3600; setcookie(BMLID, $userID, $hour); echo "You are now logged in as $userID.";[/code]and the catch is that it does NOT set the %$#&%" cookie! can someone pleaaase help me? ??? Link to comment https://forums.phpfreaks.com/topic/30404-php-setcookie/ Share on other sites More sharing options...
marcus Posted December 12, 2006 Share Posted December 12, 2006 do[code]<?php$userid = $_POST['userid'];$cookie = setcookie("BMLID",$userid,time()+3600);if(!$cookie){echo "cookie not set";}else {echo "cookie set";setcookie("BMLID",$userid,time()+3600);}?>[/code] Link to comment https://forums.phpfreaks.com/topic/30404-php-setcookie/#findComment-139942 Share on other sites More sharing options...
fert Posted December 12, 2006 Share Posted December 12, 2006 why not use sessions. Link to comment https://forums.phpfreaks.com/topic/30404-php-setcookie/#findComment-139976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.