Jump to content

Whats Wrong With This? Simple ?


mattbrown

Recommended Posts

Hi
ok im just writing a lil function to deal with changing a password and i think ive gone brain dead

the function gets 3 variables passed to it and i want it to check them like this

1 are variables $old, $new1, $new2 set
2 do variables $new1 and $new2 match
if so { do my stuff }

so i put

if((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 :-(
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.