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? ??? Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
fert Posted December 12, 2006 Share Posted December 12, 2006 why not use sessions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.