From the examples: // Get a User $params = array ( 'sid' => $session_id, 'module' => 'web', 'function' => 'user_get', 'params' => array ( user_username => 'web21_heinz' // user_username or user_id )); $user = $soapclient->call('service',$params); if($err = $soapclient->getError()) die("Error: ".$err); print_r($user);
Thanks, Till. I'm fumbling my way trying to create a form that adds a user and sends me an email. It works. The only problem is I can't get it to check if the user already exists. I can't just use the variable $user?
Please use the function that I posted above. If the function returns the data of a user in the $user array, the user exists.
Is there a way to call just the username? I'm trying to set up a check similar to the following: Code: if(trim($user)==$new_username) { $error.="That username is already taken.<br />"; } $user doesn't work because $user contains all of the information on the user.
You can try this: PHP: print_r($user);if(trim($user)==$new_username) { $error.="That username is already taken.<br />"; } You will then see which array element holds the username (e.g. $user["user_name"]).
Falko! It finally works! All I needed was the syntax to check a specific parameter in a variable. Thank you! Thank you! Thank you! Your posts are always super helpful.