rockinaway Posted September 5, 2007 Share Posted September 5, 2007 I am using this to set the expiry for a remember me: The HTML is: <input type="checkbox" name="remember" value="remember" checked="checked" /> Remember Me <br /> And the PHP used to set the expiry is: $exp = isset($_POSTS['remember']) ? time() + (60*60*24*365) : 0; But the isset() seems not to be checking if the 'remember' box was ticked or not... What could be the problem? Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/ Share on other sites More sharing options...
jitesh Posted September 5, 2007 Share Posted September 5, 2007 use $_POST['remember'] insted of $_POSTS['remember'] Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342012 Share on other sites More sharing options...
rockinaway Posted September 5, 2007 Author Share Posted September 5, 2007 Still doesn't work.. Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342013 Share on other sites More sharing options...
suma237 Posted September 5, 2007 Share Posted September 5, 2007 check this isset($_POST['remember']) ? time() + (60*60*24*365) : 0; Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342014 Share on other sites More sharing options...
rockinaway Posted September 5, 2007 Author Share Posted September 5, 2007 Yeah.. that doesn't work.. Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342015 Share on other sites More sharing options...
suma237 Posted September 5, 2007 Share Posted September 5, 2007 R u using any form method <FORM method=post></FORM>? Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342018 Share on other sites More sharing options...
rockinaway Posted September 5, 2007 Author Share Posted September 5, 2007 Yup.. post.. Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342019 Share on other sites More sharing options...
vijayfreaks Posted September 5, 2007 Share Posted September 5, 2007 Hi.. check via its value also.. i.e.: $exp = (isset($_POST['remember']) && $_POST['remember'] == 'remember') ? time() + (60*60*24*365) : 0; Regards, Vijay Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342026 Share on other sites More sharing options...
xyn Posted September 5, 2007 Share Posted September 5, 2007 or try... $exp = (isset($_POSTS['remember']) && !empty($_POST['remember'])) ? time() + (60*60*24*365) : 0; Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342040 Share on other sites More sharing options...
d22552000 Posted September 5, 2007 Share Posted September 5, 2007 you dont understand that the post remember isnt getting to his page do you? try if($_POST['remember']==true) { } EDIT: and YES I am suggesting a boolean. Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342068 Share on other sites More sharing options...
xyn Posted September 5, 2007 Share Posted September 5, 2007 actually either it isnt being set due to form fault. Or its not being set in php because of the coding which i made a suggestion. boolean will make no difference. because if its not set. then it wont be set true or false either Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342074 Share on other sites More sharing options...
rockinaway Posted September 5, 2007 Author Share Posted September 5, 2007 None of those solutions work... Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342090 Share on other sites More sharing options...
trq Posted September 5, 2007 Share Posted September 5, 2007 Post your current code. Quote Link to comment https://forums.phpfreaks.com/topic/68043-isset-not-working/#findComment-342103 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.