mattbrown Posted May 24, 2006 Share Posted May 24, 2006 Hiok im just writing a lil function to deal with changing a password and i think ive gone brain deadthe function gets 3 variables passed to it and i want it to check them like this1 are variables $old, $new1, $new2 set2 do variables $new1 and $new2 matchif so { do my stuff }so i putif((isset($old && $new1 && $new2))&&($new1 == $new)) {i know ive made a silly mistake could somebody please put me out of my misery, maybe ive been sitting at this laptop too long :-( Quote Link to comment https://forums.phpfreaks.com/topic/10347-whats-wrong-with-this-simple/ Share on other sites More sharing options...
trq Posted May 24, 2006 Share Posted May 24, 2006 You dont need to check if there set or not. If you call the function without them, you weill get an error.[code]function changepass($old,$new,$new2) { if (!$new == $new2) { return false } // do update}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10347-whats-wrong-with-this-simple/#findComment-38562 Share on other sites More sharing options...
mattbrown Posted May 24, 2006 Author Share Posted May 24, 2006 so at present i havein the page$change_pass_result changepass($oldfromform, $new1fromform ,$new2fromform)and if one of them are not set then $change_pass_result will be false? Quote Link to comment https://forums.phpfreaks.com/topic/10347-whats-wrong-with-this-simple/#findComment-38564 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.