--php opening--
//add new user and set password
$memberObj = new mxMember;
$memberObj->$_POST['object']['username'];
$memberObj->setPassword($_POST['object']['password'], '');
if (!$memberObj->add()) echo "Error adding member";
else echo "New member added";
//update member info including password
$memberObj = new mxMember;
$members = $memberObj->getAll(array('username'=>$_POST['object']['username']));
if (count($members) > 0){
foreach ($members as $member) {
$member->username = $_POST['object']['username'];
$member->updatePassword($_POST['object']['password'], '');
if (!$member->update()) echo "Error update member";
else echo "Member updated";
}
}
--php closing--
blog untuk rujukan sendiri dan mungkin juga untuk perkongsian (bagi yang bersesuaian) berkaitan subjek teknikal IT, atau secara khususnya penumpuan lebih kepada pengaturcaraan.
Comments
Post a Comment