• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP updateUser函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中updateUser函数的典型用法代码示例。如果您正苦于以下问题:PHP updateUser函数的具体用法?PHP updateUser怎么用?PHP updateUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了updateUser函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: recruitSoldier

function recruitSoldier($id) {
	$com = getUserDetails($id, "commander");
	updateUser($id, " exp =exp+6,clicks=clicks+4");
	if ($com->commander AND $com->commander == $_SESSION['isLogined']) {
		updateUser($com->commander, " exp =exp+3,clicks=clicks+1,uu=uu+1");
	}
}
开发者ID:Naddiseo,项目名称:WW2Game,代码行数:7,代码来源:recruit.php


示例2: processRequest

/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/usermanager.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    $action = v($_REQUEST["id"]);
    include BASE_PATH . "/lib/usermanager.php";
    $legacyServer = Session::get('db', 'version') < 5;
    $editor = new userManager($db, $legacyServer);
    $message = '';
    if ($action != '') {
        if ($action == "add") {
            $result = addUser($db, v($_REQUEST["query"]), $editor);
        } else {
            if ($action == "delete") {
                $result = deleteUser($db, v($_REQUEST["query"]), $editor);
            } else {
                if ($action == "update") {
                    $result = updateUser($db, v($_REQUEST["query"]), $editor);
                }
            }
        }
        if ($result) {
            $db->flush('PRIVILEGES', true);
            $message = __('The command executed successfully');
        } else {
            $message = __('Error occurred while executing the query');
        }
    }
    displayUserForm($db, $editor, $message, $action);
}
开发者ID:guohuadeng,项目名称:stampApp,代码行数:37,代码来源:usermanager.php


示例3: commandRouter

function commandRouter($action)
{
    switch ($action) {
        case 'login':
            loginUser();
            break;
        case 'createUser':
            createUser();
            break;
        case 'getUser':
            getUser();
            break;
        case 'deleteUser':
            deleteUser();
            break;
        case 'updateUser':
            updateUser();
            break;
        case 'addTab':
            addTab();
            break;
        case 'delTab':
            delTab();
            break;
        case 'editTab':
            editTab();
            break;
        case 'getTabs':
            getTabs();
            break;
        case 'addNote':
            addNote();
            break;
        case 'delNote':
            delNote();
            break;
        case 'editNote':
            editNote();
            break;
        case 'getNotes':
            getNotes();
            break;
        default:
            break;
    }
}
开发者ID:harvPrentiss,项目名称:ToDo,代码行数:46,代码来源:dataRetriever.php


示例4: parseURI

function parseURI()
{
    parse_str($_SERVER['QUERY_STRING'], $params);
    $ustreamUID = $params['ustreamUID'] ? $params['ustreamUID'] : NULL;
    $longitude = $params['longitude'] ? $params['longitude'] : NULL;
    $latitude = $params['latitude'] ? $params['latitude'] : NULL;
    $event = $params['event'] ? $params['event'] : NULL;
    echo "uid: " . $ustreamUID . " latitude: " . $latitude . " longitude: " . $longitude . " event: " . $event . "<br/>";
    if ($ustreamUID && $longitude && $latitude && $event) {
        if (findUser($ustreamUID)) {
            updateUser($ustreamUID, $longitude, $latitude, $event);
        } else {
            insertUser($ustreamUID);
            updateUser($ustreamUID, $longitude, $latitude, $event);
        }
    }
}
开发者ID:nzukoski,项目名称:Misc,代码行数:17,代码来源:parser.php


示例5: commandRouter

function commandRouter($action)
{
    switch ($action) {
        case 'login':
            loginUser();
            break;
        case 'createUser':
            createUser();
            break;
        case 'getUser':
            getUser();
            break;
        case 'deleteUser':
            deleteUser();
            break;
        case 'updateUser':
            updateUser();
            break;
        case 'addInv':
            addToInv();
            break;
        case 'subInv':
            subFromInv();
            break;
        case 'getInv':
            getInventory();
            break;
        case 'getDecks':
            getDecks();
            break;
        case 'createDeck':
            createDeck();
            break;
        case 'updateDeck':
            updateDeck();
            break;
        case 'deleteDeck':
            deleteDeck();
            break;
        default:
            break;
    }
}
开发者ID:harvPrentiss,项目名称:Magic,代码行数:43,代码来源:dataRetriever.php


示例6: modifyUser

     //END-OF-FIX
 // END: HACK - ADVANCED USER MANAGER
 //END-OF-FIX
 case "modifyUser":
     //FIX:DOMSNITT
     // START: HACK - ADVANCED USER MANAGER
     //modifyUser($chng_uid);
     modifyUser($chng_uid, $viewmode, $sortorder, $start);
     // END: HACK - ADVANCED USER MANAGER
     //END-OF-FIX
     break;
 case "updateUser":
     //FIX:DOMSNITT
     // START: HACK - ADVANCED USER MANAGER
     //updateUser($chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_user_icq, $chng_user_aim, $chng_user_yim, $chng_user_msnm, $chng_user_from, $chng_user_occ, $chng_user_intrest, $chng_user_viewemail, $chng_avatar, $chng_user_sig, $chng_pass, $chng_pass2, $chng_newsletter, $subscription, $subscription_expire, $reason);
     updateUser($chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_user_icq, $chng_user_aim, $chng_user_yim, $chng_user_msnm, $chng_user_from, $chng_user_occ, $chng_user_intrest, $chng_user_viewemail, $chng_avatar, $chng_user_sig, $chng_pass, $chng_pass2, $chng_newsletter, $subscription, $subscription_expire, $reason, $viewmode, $sortorder, $start);
     // END: HACK - ADVANCED USER MANAGER
     //END-OF-FIX
     break;
 case "delUser":
     include "header.php";
     GraphicAdmin();
     OpenTable();
     echo "<center><font class=\"title\"><b>" . _USERADMIN . "</b></font></center>";
     CloseTable();
     echo "<br>";
     OpenTable();
     echo "<center><font class=\"option\"><b>" . _DELETEUSER . "</b></font><br><br>" . "" . _SURE2DELETE . " {$chng_uid}?<br><br>" . "";
     //FIX:DOMSNITT
     // START: HACK - ADVANCED USER MANAGER - One Line up
     //		."[ <a href=\"".$admin_file.".php?op=delUserConf&amp;del_uid=$chng_uid\">" . _YES . "</a> | <a href=\"".$admin_file.".php?op=mod_users\">" . _NO . "</a> ]</center>";
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:31,代码来源:index.php


示例7: while

    echo '{"result":1,"users":[';
    //start of json object
    while ($row) {
        echo json_encode($row);
        //convert the result array to json object
        $row = $obj->fetch();
        if ($row) {
            echo ",";
            //if there are more rows, add comma
        }
    }
    echo "]}";
    //end of json array and object
}
switch ($cmd) {
    case 1:
        addUser($_REQUEST['user_name'], $_REQUEST['user_id'], $_REQUEST['user_pass'], $_REQUEST['user_type']);
        break;
    case 2:
        updateUser($_REQUEST['user_id'], $_REQUEST['user_name'], $_REQUEST['user_pass'], $_REQUEST['user_type']);
        break;
    case 3:
        delete($_REQUEST['user_id']);
        break;
    case 4:
        searchUser();
        break;
    default:
        # code...
        break;
}
开发者ID:Wainaina3,项目名称:pos,代码行数:31,代码来源:userManipulation.php


示例8: header

<?php

header('Content-Type: application/json; charset=utf-8');
/*
	---- VALUE ----
	.Get name
	.Get id
	Non obligatoire :
		.Get matiere
		.Get name
		.Get password
		.Get roles
*/
include 'co_Bdd.php';
echo "test";
$disp = updateUser();
echo $disp;
//echo json_encode($disp, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo "test";
function updateUser()
{
    /*
    	foreach ( $_GET as $key => $value )
    	{
     	   if(iconv_strlen($_GET[$key])==0) {
     	   		if($key == "matiere"){
     	   			//$_GET[$key] = actionArray($_GET[$key], $User[$key]);
     	   		}
     	   		$_GET[$key] = $User[$key];
     	   }
    	}
开发者ID:hugo082,项目名称:API_FamillyApp,代码行数:31,代码来源:test.php


示例9: saveCard

                    $creditCardId = saveCard($newCard);
                    $card = getCreditCard($creditCardId);
                }
            }
            // Update password if new password data has been provided
            if (isset($_POST['user']['password'])) {
                if ($_POST['user']['password'] == $_POST['user']['password_confirmation']) {
                    $newPassword = $_POST['user']['password'];
                } else {
                    $message = "The new password did not match your confirm password.";
                    $messageType = "error";
                }
            }
            // update credit card info OR/AND password in our database
            if (!isset($message) && (isset($newPassword) || isset($creditCardId))) {
                updateUser($_POST['user']['email'], $newPassword, $creditCardId);
                $message = "Your profile has been updated.";
                $messageType = "success";
            }
        } else {
            $message = "The current password that you provided is invalid.";
            $messageType = "error";
        }
    }
} catch (\PayPal\Exception\PPConnectionException $ex) {
    $message = parseApiError($ex->getData());
    $messageType = "error";
} catch (Exception $ex) {
    $message = $ex->getMessage();
    $messageType = "error";
}
开发者ID:18653675059,项目名称:rest-api-sample-app-php,代码行数:31,代码来源:profile.php


示例10: editUserForm

function editUserForm()
{
    if ($_POST['isPostback']) {
        // now we process the form
        $defaults = $_POST;
        // validation and trimming
        $_POST['tbPass'] = trim($_POST['tbPass']);
        $_POST['tbFirst'] = trim($_POST['tbFirst']);
        $_POST['tbLast'] = trim($_POST['tbLast']);
        $_POST['tbEmail'] = trim($_POST['tbEmail']);
        if (strlen($_POST['tbPass']) > 0 && strlen($_POST['tbPass']) < 4) {
            $errors[] = "Your password must be more than 4 characters long";
        }
        if (strlen($_POST['tbFirst']) == 0) {
            $errors[] = "You must enter a first name";
        }
        if (strlen($_POST['tbLast']) == 0) {
            $errors[] = "You must enter a last name";
        }
        if (!preg_match('/^[^@\\s]+@([-a-z0-9]+\\.)+[a-z]{2,}$/i', $_POST['tbEmail'])) {
            $errors[] = "You must enter a valid email address";
        }
        if (strlen(strval(intval($_POST['tbPhone1A'] . $_POST['tbPhone1B'] . $_POST['tbPhone1C']))) < 10) {
            $errors[] = "Please enter a valid primary phone number";
        }
        if (strlen($_POST['tbPhone2A'] . $_POST['tbPhone2B'] . $_POST['tbPhone2C'])) {
            if (strlen(strval(intval($_POST['tbPhone2A'] . $_POST['tbPhone2B'] . $_POST['tbPhone2C']))) < 10) {
                $errors[] = "Please enter a valid secondary phone number";
            }
        }
        if ($_POST['tbPay'] != strval(floatval($_POST['tbPay']))) {
            $errors[] = "You must enter a valid hourly rate";
        }
        if (!$errors) {
            // our input is clean, go ahead and submit
            $sInsertError = updateUser($_POST);
            redirect("myEmps.php");
        }
    } else {
        // get current details for user
        $aUserVals = getUserVals($_REQUEST['u_id']);
        $aPhone1 = formatPhoneNum($aUserVals->user_phone1);
        $aPhone2 = formatPhoneNum($aUserVals->user_phone2);
        $defaults['tbPass'] = $aUserVals->user_pass;
        $defaults['tbFirst'] = $aUserVals->user_first;
        $defaults['tbLast'] = $aUserVals->user_last;
        $defaults['tbEmail'] = $aUserVals->user_email;
        $defaults['tbPhone1A'] = $aPhone1[0];
        $defaults['tbPhone1B'] = $aPhone1[1];
        $defaults['tbPhone1C'] = $aPhone1[2];
        $defaults['tbPhone2A'] = $aPhone2[0];
        $defaults['tbPhone2B'] = $aPhone2[1];
        $defaults['tbPhone2C'] = $aPhone2[2];
        $defaults['tbPay'] = $aUserVals->user_pay_rate;
        $defaults['hdID'] = $aUserVals->user_id;
        $defaults['cbActive'] = $aUserVals->user_inactive;
    }
    // get the list of supervisors
    $aSupers = getSupervisors();
    // get employees supervisors
    $aEmpSupers = getEmpSupervisors($aUserVals->user_id);
    foreach ($aEmpSupers as $EmpSuper) {
        $aSelectedSupers[] = $EmpSuper->super_super;
    }
    // get the user types < the current user
    $aTypes = getUserTypes($_SESSION['USERTYPE']);
    ?>
<form action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post" name="frmAddUser"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
	<input name="hdID" type="hidden" value="<?php 
    echo $defaults['hdID'];
    ?>
">
  <tr>
    <td colspan="2"><strong>Edit User</strong></td>
  </tr>
  <?php 
    if (isset($sInsertError)) {
        print "<tr><td colspan=2><span class=errorMsg>{$sInsertError}</span></td></tr>";
    }
    if ($errors) {
        print "<tr><td colspan=2 class=errorMsg><strong>Please correct the following errors:</strong><br><ul><li>";
        print implode('</li><li>', $errors);
        print "</li></td></tr>";
    }
    ?>
  <tr class="evenRow">
    <td width="26%">Username </td>
    <td width="74%"><?php 
    echo $aUserVals->user_name;
    ?>
    </td>
  </tr>
  <tr>
    <td>User Password </td>
    <td><input name="tbPass" type="password" id="tbPass" size="10" maxlength="20"></td>
  </tr>
  <tr class="evenRow">
//.........这里部分代码省略.........
开发者ID:atrommer,项目名称:ESS,代码行数:101,代码来源:editUser.php


示例11: while

        if (!$deleted) {
            $msg = "Database Error: {$ax['usr_not_deleted']}";
            break;
        }
        $msg = $ax['usr_deleted'];
    } while (false);
    return $msg;
}
//Control logic
if ($privs >= 4) {
    //manager or admin
    $msg = '';
    if (isset($_POST['addExe'])) {
        $msg = addUser($user);
    } elseif (isset($_POST['updExe'])) {
        $msg = updateUser($user);
    } elseif (isset($_GET['delExe'])) {
        $msg = deleteUser($user);
    }
    echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n";
    if (!$mode or isset($_POST["back"])) {
        showUsers();
        //no add / no edit
    } else {
        editUser($user);
        //add or edit
    }
    echo "</div>\n</div>\n";
} else {
    echo "<p class='error'>{$ax['no_way']}</p>\n";
}
开发者ID:sanluca,项目名称:py-acqua-hw,代码行数:31,代码来源:users.php


示例12: selectUser

        echo selectUser();
        break;
    case 'selectMates':
        echo selectMates();
        break;
    case 'selectTop3':
        echo selectTop3();
        break;
    case 'addUser':
        echo addUser();
        break;
    case 'addParticipation':
        echo addParticipation();
        break;
    case 'updateUser':
        echo updateUser();
        break;
    case 'updateShare':
        echo updateShare();
        break;
    default:
        $error = array("error" => "Undefined function.");
        echo json_encode($error);
        break;
}
$dbh = null;
function isXMLHTTPRequest()
{
    if (!sizeError($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
        return true;
    } else {
开发者ID:sylvhama,项目名称:summer2015,代码行数:31,代码来源:do.php


示例13: dbQuery

        }
        $result = dbQuery("UPDATE [db]users SET status = -1 WHERE user_id = {$uid}");
        if (!$result) {
            $msg = "Database Error: {$ax['usr_not_deleted']}";
            break;
        }
        $msg = $ax['usr_deleted'];
    } while (false);
    return $msg;
}
//Control logic
if ($privs >= 4) {
    //manager or admin
    $msg = '';
    if (isset($_POST['addExe'])) {
        $msg = addUser();
    } elseif (isset($_POST['updExe'])) {
        $msg = updateUser();
    } elseif (isset($_GET['delExe'])) {
        $msg = deleteUser();
    }
    echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n";
    if ($editUser != 'y' or isset($_POST["back"])) {
        showUsers();
    } else {
        editUser($uid);
    }
    echo "</div>\n</div>\n";
} else {
    echo "<p class='error'>{$ax['no_way']}</p>\n";
}
开发者ID:krievley,项目名称:schedule,代码行数:31,代码来源:users.php


示例14: updateUser

<?php

if (isset($_GET['update']) && $_GET['update'] == "1") {
    $update = updateUser($manceUser['manceID']);
    if ($update) {
        ?>
<div class="alert alert-success alert-dismissible" role="alert" style="margin-top: 10px;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> Data updated for this user!</div>
<?php 
    } else {
        $steamidexists = updateSteam($manceUser['manceID']);
        if ($steamidexists == 1) {
            ?>
<div class="alert alert-success alert-dismissible" role="alert" style="margin-top: 10px;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> Data failed to update for this user, but steam updated his name!</div>
<?php 
        } else {
            if ($steamidexists === FALSE) {
                ?>
<div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: 10px;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> Data failed to update for this user, and steam is not updating his name!</div>
<?php 
            } else {
                ?>
<div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: 10px;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> Could not update your data. You must play at least one ranked game under your current Steam name in order to update</div>
<?php 
            }
        }
    }
}
$search = $db->query("SELECT * FROM log WHERE user='" . $manceUser['manceID'] . "' AND server='{$server}'");
?>
<script>
r(function() {
开发者ID:NiciusB,项目名称:Brawlmance,代码行数:31,代码来源:you.php


示例15: urldecode

require_once 'loader.php';
$Email = urldecode($_POST['Email']);
$Password = urldecode($_POST['Password']);
$Name = urldecode($_POST['Name']);
$Age = urldecode($_POST['Age']);
$Contact = urldecode($_POST['Contact']);
$City = urldecode($_POST['City']);
$State = urldecode($_POST['State']);
$sex = urldecode($_POST['sex']);
$GcmId = urldecode($_POST['GcmId']);
$profile_pic = urldecode($_POST['profile_pic']);
$facebook = false;
if (isset($_POST['Type'])) {
    $facebook = true;
}
$res = isUserExisted($Email);
if ($res) {
    if ($facebook) {
        updateUser($Email, $Password, $Name, $Age, $Contact, $City, $State, $sex, $GcmId, $profile_pic);
        getUserDetail($Email);
    } else {
        echo "user_exits";
    }
} else {
    if ($facebook) {
        $res = storeFacebookUser($Email, $Password, $Name, $Age, $Contact, $City, $State, $sex, $GcmId, $profile_pic);
    } else {
        $res = storeUser($Email, $Password, $Name, $Age, $Contact, $City, $State, $sex, $GcmId, $profile_pic);
    }
    getUserDetail($Email);
}
开发者ID:rakshithraj,项目名称:smart_complaint,代码行数:31,代码来源:register.php


示例16: updateProfile

function updateProfile($user_id, $user)
{
    $user = validateFixProfile($user);
    if (is_string($user)) {
        # error msg
        return $user;
    }
    if (checkPasswordById($user_id, $user["current_password"])) {
        return INVALID_CURRENT_PASS_ERR;
    }
    if ($user["password"] !== "") {
        $checkPasswords = checkPasswords($user["password"], $user["confirm_password"]);
        if (is_string($checkPasswords)) {
            return $checkPasswords;
        }
    } else {
        $user["password"] = $user["current_password"];
    }
    $newEmail = false;
    if (getFullUserById($user_id)["email"] !== $user["email"]) {
        # user changed email
        if (userExists($user["email"]) === true) {
            return ACCOUNT_ALREADY_EXISTS_ERR . UPDATE_FAIL_ERR;
        }
        $newEmail = true;
    }
    if (updateUser($user_id, $user) === true) {
        if ($newEmail === true) {
            $code = updateCode($user_id);
            if (is_string($code)) {
                sendActivationMail($user["email"], $user_id, $code);
            }
        }
        return true;
    } else {
        return false;
    }
}
开发者ID:rw00,项目名称:tutorme,代码行数:38,代码来源:InfoManager.php


示例17: move_uploaded_file

if (isset($_POST["uId"]) && isset($_POST["uName"])) {
    //ID和用户名都不为空
    if ($_FILES["myHead"]["error"] == 0) {
        //如果图片上传成功
        $myHead = $_FILES["myHead"];
        //获取上传的图片
        $head = $_POST["uId"] . "_" . $myHead['name'];
        //取出文件名
        if (($myHead["type"] == "image/gif" || $myHead["type"] == "image/jpeg" || $myHead["type"] == "image/pjpeg") && $myHead["size"] < 50000) {
            //进行文件格式和大小的过滤
            move_uploaded_file($myHead[tmp_name], "../image/head/" . $head);
            //上传
        } else {
            $msg = "上传文件格式应为gif或jpg,且文件大小应为小于50KB";
        }
        //上传成功时,更新数据库,设置头像为自定义头像
        $rs = updateUser($_POST['uId'], $_POST['uName'], $_POST['uPass'], $head, $_POST['gender']);
    } else {
        //已经自定义了头像,且不变时
        $rs = updateUser($_POST['uId'], $_POST['uName'], $_POST['uPass'], $_POST['head'], $_POST['gender']);
    }
    if ($rs <= 0) {
        $msg = "用户修改失败!";
    } else {
        header("location: ./doLogout.php");
        return;
    }
} else {
    $msg = "用户名为空或无法获取用户编号";
}
header("location: ../error.php?msg={$msg}");
开发者ID:JuneBlueberry,项目名称:JunchenBBS,代码行数:31,代码来源:doUserUpdate.php


示例18: checkDataUser

    if (!isset($_POST['pseudo']) || !preg_match('/^[a-zA-Z0-9-_ ]{4,25}$/', $_POST['pseudo'])) {
        return "Pseudo invalide, il ne doit être composé que de lettres.";
    }
    if ($Model->isPseudoInDb($_POST['pseudo']) && $user->pseudo != $_POST['pseudo']) {
        return "Pseudo déjà utilisé, merci d'en choisir un autre.";
    }
    if (!isset($_POST['nom']) || !preg_match('/^[a-zA-Z- ]{4,25}$/', $_POST['nom'])) {
        return "Nom invalide, il ne doit être composé que de lettres.";
    }
    if (!isset($_POST['prenom']) || !preg_match('/^[a-zA-Z- ]{4,25}$/', $_POST['prenom'])) {
        return "Prenom invalide, il ne doit être composé que de lettres.";
    }
    if (!isset($_POST['email']) || !preg_match('/^[a-zA-Z][-a-zA-Z0-9_]*@[a-zA-Z]*\\.[a-z]{2,5}$/', $_POST['email'])) {
        return "Email invalide, merci de rentrer un mail valide de l'amu !";
    }
    if (!isset($_POST['email2']) || $_POST['email'] != $_POST['email2']) {
        return "Les deux emails ne correspondent pas.";
    }
    return "NoError";
}
if (isset($_POST['Modifier'])) {
    $error = checkDataUser($Model, $user);
    if ($error == "NoError") {
        updateUser($_POST['pseudo'], $_POST['nom'], $_POST['prenom'], $_POST['email']);
        header('Location : index.php?page=profil');
    } else {
        echo $error;
    }
}
require_once Config::$path['views'] . 'HTML.class.php';
require_once Config::$path['views'] . 'modifier.php';
开发者ID:sebspas,项目名称:AFK-WEB,代码行数:31,代码来源:modifier.php


示例19: tournament

function tournament()
{
    global $wpdb, $user_identity, $user_ID;
    header('Content-Type: text/html; charset=' . getCharset() . '');
    if (intval($_REQUEST['matchid']) > 0 && intval($_REQUEST['opt']) > 0) {
        echo "参数错误!";
        exit;
    }
    $matchid = intval($_REQUEST['matchid']);
    if (!empty($user_identity)) {
        $username = htmlspecialchars(addslashes($user_identity));
    } else {
        if (!empty($_COOKIE['comment_author_' . COOKIEHASH])) {
            $username = htmlspecialchars(addslashes($_COOKIE['comment_author_' . COOKIEHASH]));
        } else {
            echo "需要登陆";
            exit;
        }
    }
    switch ($_REQUEST['opt']) {
        case 'apply':
            if (!getUserVerify($user_ID)) {
                echo "需要选手认证才可以报名";
                exit;
            }
            $apply = $wpdb->query("SELECT verify1 FROM pre_common_member_verify WHERE uid = {$user_ID}");
            if (count(getUserList($user_ID, $matchid, -1, -1, 1)) > 0) {
                echo "你已经报过名了";
                exit;
            }
            updateUser($user_ID, $matchid, -1, -1, 1);
            if (count(getUserList($user_ID, $matchid, -1, -1, 1)) > 0) {
                echo "报名成功!";
                exit;
            }
            echo "报名时发生错误";
            exit;
        case 'cancelapply':
            updateUser($user_ID, $matchid, -1, -1, 0);
            echo "报名已取消";
            exit;
        case 'follow':
            updateUser($user_ID, $matchid, -1, 1);
            if (count(getUserList($user_ID, $matchid, -1, 1)) > 0) {
                echo "关注成功!";
                exit;
            }
            echo "关注时发生错误";
            exit;
        case 'cancelfollow':
            updateUser($user_ID, $matchid, -1, 0);
            echo "关注已取消";
            exit;
        case 'cancelgroup':
            $groupid = intval($_REQUEST['groupid']);
            $memberid = intval($_REQUEST['memberid']);
            $users = getUserList($memberid);
            if (empty($users)) {
                echo "找不到此用户ID, " . $memberid;
                exit;
            }
            $groups = getGroupList(-1, $groupid);
            if (empty($groups)) {
                echo "找不到此队伍ID, " . $groupid;
                exit;
            }
            $matchs = getMatchList($groups[0]->match_id);
            if (empty($matchs)) {
                echo "找不到此队伍的比赛ID, error code : " . $groups[0]->match_id;
                exit;
            }
            if ($matchs[0]->stage != 1) {
                echo "比赛不处于报名阶段,无法退出 . error code : " . $groups[0]->match_id;
                exit;
            }
            if ($groups[0]->captain_id == $user_ID || $memberid == $user_ID) {
                // 队员离开
                updateUser($memberid, $matchid, 0, -1, -1, 0, -1, 0);
                echo "已退出队伍";
                exit;
            }
            echo "权限不足.";
            exit;
        case 'applygroup':
            $users = getUserList($user_ID, $matchid);
            if (!empty($users)) {
                $groupid = $_REQUEST['groupid'];
                if (intval($users[0]->apply_group)) {
                    echo "您已经申请了其他的队伍!";
                    exit;
                }
                $groups = getGroupList($matchid, $groupid);
                if (empty($groups)) {
                    echo "比赛" . $matchid . "中找不到这个队伍!" . $groupid;
                    exit;
                }
                $groupusers = getUserList(-1, -1, $groupid);
                if ($groups[0]->maxpeople - 1 < count($groupusers)) {
                    echo "这个队伍中的人数已经满了!" . $groupid;
                    exit;
//.........这里部分代码省略.........
开发者ID:hotmob,项目名称:likedome,代码行数:101,代码来源:tournament.php


示例20: PDO

    if ($database == null) {
        try {
            $database = new PDO("mysql:host=" . $params[0] . ";dbname=" . $params[1], $params[2], $params[3]);
            $database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $except) {
            echo $except->getMessage();
            die;
        }
    }
    return $database;
}
if (isset($_POST['SubmitAdd'])) {
    basicInsert($Name, $Surname, $Nickname, $Email, $Password, $AboutYou, $Birthday);
}
if (isset($_POST['SubmitUpdate'])) {
    updateUser($Id, $Name, $Surname, $Nickname, $Email, $Password, $AboutYou, $Birthday);
}
/* function insertIntoDatabase() /* Version Alpha 0.0.1
{
    $params = func_get_args();

    $iterations = ((count($params)-1)/2);
    $numParams = 1;

    $prepare = "INSERT INTO " . $params[0] . " (";

    for ($iterations; $iterations > 0; $i--) {
        if ($iterations = 1)
        {
            $prepare . $params[$numParams] . ") ";
        }
开发者ID:JonathanDeclercq,项目名称:M151,代码行数:31,代码来源:DB_functions.php



注:本文中的updateUser函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP updateUserAppNum函数代码示例发布时间:2022-05-23
下一篇:
PHP updateTable函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap