當前位置: 首頁>>代碼示例>>PHP>>正文


PHP randomPassword函數代碼示例

本文整理匯總了PHP中randomPassword函數的典型用法代碼示例。如果您正苦於以下問題:PHP randomPassword函數的具體用法?PHP randomPassword怎麽用?PHP randomPassword使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了randomPassword函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: forgetPassword

function forgetPassword($userLogin, $userCPF)
{
    //get security ;)
    $userLogin = mysql_real_escape_string($userLogin);
    $userCPF = mysql_real_escape_string($userCPF);
    //select validate data sent by POST
    $query = mysql_query("SELECT `userLogin`, `userCPF`, `userMail` FROM `users` WHERE `userLogin` = '" . $userLogin . "' AND `userCPF` = '" . $userCPF . "' LIMIT 1");
    $return = mysql_num_rows($query);
    $result = mysql_fetch_assoc($query);
    if ($return == 0) {
        //oh shit!
        return false;
    } else {
        //generate and encrypt password
        $newPassword = randomPassword(6, true, true, false);
        $encryptedNewPassword = md5($newPassword);
        //update password
        $updateNewPassword = "UPDATE users SET `userPassword`='" . $encryptedNewPassword . "', `userChangePassword`='1' WHERE userLogin = '" . $userLogin . "' AND userCPF = '" . $userCPF . "'";
        $query = mysql_query($updateNewPassword);
        # SETTINGS TO SEND EMAIL FOR USER
        $to = $result['userMail'];
        $subject = "PGA - SEMED: Alteração de Senha";
        $message = "\n\t\t<html>\n\t\t<body>\n\t\t  <h3>Alteração de Senha</h3><br />\n\t\t  Sua nova senha é: <b>" . $newPassword . "</b>\n\t\t</body>\n\t\t</html>";
        $from = "pga.semed@gmail.com";
        $headers = "From: " . $from . "\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
        mail($to, $subject, $message, $headers);
        return true;
    }
}
開發者ID:caiodavinis,項目名稱:dvinesweb,代碼行數:31,代碼來源:class.ForgetPassword.php

示例2: verify_email

 public function verify_email()
 {
     //Setting up validation rules for form inputs
     $this->validation_rules = array(array('field' => 'username', 'label' => 'username', 'rules' => 'required|callback_validate_hoteluser', 'class' => 'text-danger'));
     $this->form_validation->set_error_delimiters('<div class="bg-danger">', '</div>');
     $this->form_validation->set_rules($this->validation_rules);
     $this->form_validation->set_message('validate_hoteluser', 'Hotel User with this username is not exist.');
     //$this->form_validation->set_message('valid_email','Please Enter Valid Email.');
     if ($this->form_validation->run() == FALSE) {
         $this->data['action'] = "/login/verify_user";
         $this->template->load('login_tpl', 'recovery_vw', $this->data);
     } else {
         //Get User Id From Email
         $user_info = $this->User_model->get_user_by_name($this->input->post('username'));
         $user_id = $user_info[0]['sb_hotel_user_id'];
         $hotelusername = $user_info[0]['sb_hotel_username'];
         $password = randomPassword();
         $hotel_user_data = array();
         $hotel_user_data['sb_hotel_userpasswd'] = createHashAndSalt($password);
         $result = $this->Hotel_model->edit_hotel_user($hotel_user_data, $user_id);
         $data = array();
         $data['password'] = $password;
         $data['hotelusername'] = $hotelusername;
         $message = $this->load->view('email/forgotpassword', $data, TRUE);
         sendMail('no-reply@sebastian.com', $user_info[0]['sb_hotel_useremail'], "Forgot Password", $message);
         $this->session->set_flashdata('SuccMsg', SUC_MSG_LEVEL_2);
         redirect('admin/login');
     }
 }
開發者ID:JasoonS,項目名稱:SebastianServer,代碼行數:29,代碼來源:Recover.php

示例3: reset_password

function reset_password($username)
{
    //generates a random password for the user and puts it into the database
    //first generate a random password
    $randomPassword = randomPassword();
    $conn = db_connect();
    $result = $conn->query("UPDATE user SET password='{$randomPassword}' WHERE username = '{$username}' ");
    if (!$result) {
        throw new Exception("Could not reset password. Please try again.");
    }
    return $randomPassword;
}
開發者ID:HoGil,項目名稱:phpUrlApp,代碼行數:12,代碼來源:user_auth_fns.php

示例4: register

    function register($addmemberclass, $editid)
    {
        global $db;
        $postvar = $addmemberclass->getPostVar();
        $user_id = $_SESSION['USER_ID'];
        $first_name = mysql_real_escape_string(trim($postvar['first_name']));
        $last_name = mysql_real_escape_string(trim($postvar['last_name']));
        $email = mysql_real_escape_string(trim($postvar['email']));
        $usertype = mysql_real_escape_string(trim($postvar['usertype']));
        $password = randomPassword();
        $pass = sha1(mysql_real_escape_string($password));
        $hash = md5(rand(0, 1000));
        $codeverify = mysql_real_escape_string($hash);
        $sql_url = "SELECT * FROM tc_urlsetting WHERE id = '1'";
        $res_url = $db->select_data($sql_url);
        $logos = stripslashes($res_url[0]['status']);
        if ($logos == "test") {
            $liveurl = $res_url[0]['test_url'];
        } else {
            $liveurl = $res_url[0]['live_url'];
        }
        if ($editid == "") {
            $sql = "INSERT INTO `api_users`(`first_name`,`last_name`, `email`, `userid`, `password`, `usertype`, `is_active`, `created`,`online`,`modified`,`owner_id`,`hash`) VALUES ('{$first_name}','{$last_name}','{$email}','{$userid}','{$pass}','{$usertype}','0',now(),'0','','{$user_id}','{$codeverify}')";
            $result = $db->insert_data($sql);
            $in_id = mysql_insert_id();
            if ($in_id != "") {
                $to = $email;
                $subject = "Confirm Your Account.";
                $from = $memail;
                $headers = 'MIME-Version: 1.0' . "\r\n";
                $headers .= 'X-Mailer: PHP/' . phpversion() . "\n";
                $headers .= 'Reply-To:' . $to . "\r\n";
                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                $headers .= "From: {$from}";
                $text = '<html><body><div style=\\"width:100%;\\">
						<table>
									<tr>
										<td><a href="' . $liveurl . '" target="_blank"><img src="' . $liveurl . 'images/logo.jpg" /></a></td>
									</tr>
								</table>
						<table width="100%" cellspacing="15" cellpadding="0" border="0" bgcolor="#E8F1FA" align="center" style="font-family:Helvetica,Arial,serif">
						<tr><td><b>Hello ' . ucfirst($first_name) . ',</b></td></tr>					
						
						<tr><td colspan="2" style="font-size: 18px!important;color:#15c!important;"><p style=\\"font-family: Verdana,Arial,Helvetica,sans-serif;font-size: 18px!important;color:#15c!important;\\">Thanks for signing up!
								Your account has been created, you can confirm your account by click on below url.</p></td></tr>						
						<tr><td>&nbsp;<a href="' . $liveurl . 'verify.php?email=' . $email . '&hash=' . $hash . '" target="blank">Confirm Your Account</a></td></tr>
						<tr><td colspan="2"><b>Your Login details are:-</b></td></tr>
						<tr><td colspan="2"><b>EmailID:-</b> ' . stripslashes($email) . '</td>
						</tr>						
						<tr><td colspan="2"><b>Password:-</b> ' . $password . '</td>						
						<tr><td>&nbsp;</td></td>
						<tr><td colspan="2" style="font-size: 18px!important;color:#15c!important;"><b>After login you can change your password for security.</b></td></tr>
						<tr><td><b>Sincerely,</b></td></tr>						
						<tr><td><b>' . $liveurl . '</b></td></tr>					  
						</table></div></body></html>';
                $message = $text;
                @mail($to, $subject, $message, $headers);
            }
            $msg = "Congratulations, User Created successfully.";
            return $msg;
        } else {
            /*$up_sql = "UPDATE `eventer_events` SET `start_date`='$frmdate',`end_date`='$tdate',`start_time`='$start_time',`end_time`='$end_time',`title`='$title',`description`='$description',`venue`='$venue',`link`='$link',`image_alignment`='$image_alignment'";
            		if($_FILES['file']['name']!=""){ $up_sql .= ",`file`='$path'"; }
            		$up_sql .=  ",`status`='$status' WHERE  users_id = '$editid' ";*/
        }
        //$res_sql = $db->update_data($up_sql);
        $in_id = mysql_insert_id();
        if (count($res_sql) > 0) {
            $msg1 = "Record Updated Successfully.";
            return $msg1;
        }
    }
開發者ID:Entellus,項目名稱:System,代碼行數:72,代碼來源:add_users_manager.php

示例5: array

         $dataUsername = array("username" => $username);
         $sqlUsername = "SELECT * FROM gibbonPerson WHERE username=:username";
         $resultUsername = $connection2->prepare($sqlUsername);
         $resultUsername->execute($dataUsername);
     } catch (PDOException $e) {
         $gotUsername = false;
         print "<div class='error'>" . $e->getMessage() . "</div>";
     }
     if ($resultUsername->rowCount() == 0 and $gotUsername == true) {
         $continueLoop = FALSE;
     } else {
         $username = $usernameBase . $count;
     }
     $count++;
 }
 $password = randomPassword(8);
 $salt = getSalt();
 $passwordStrong = hash("sha256", $salt . $password);
 if ($continueLoop == FALSE) {
     $insertOK = true;
     try {
         $data = array("username" => $username, "passwordStrong" => $passwordStrong, "passwordStrongSalt" => $salt, "title" => $row["parent2title"], "surname" => $row["parent2surname"], "firstName" => $row["parent2firstName"], "preferredName" => $row["parent2preferredName"], "officialName" => $row["parent2officialName"], "nameInCharacters" => $row["parent2nameInCharacters"], "gender" => $row["parent2gender"], "parent2languageFirst" => $row["parent2languageFirst"], "parent2languageSecond" => $row["parent2languageSecond"], "citizenship1" => $row["parent2citizenship1"], "nationalIDCardNumber" => $row["parent2nationalIDCardNumber"], "residencyStatus" => $row["parent2residencyStatus"], "visaExpiryDate" => $row["parent2visaExpiryDate"], "email" => $row["parent2email"], "phone1Type" => $row["parent2phone1Type"], "phone1CountryCode" => $row["parent2phone1CountryCode"], "phone1" => $row["parent2phone1"], "phone2Type" => $row["parent2phone2Type"], "phone2CountryCode" => $row["parent2phone2CountryCode"], "phone2" => $row["parent2phone2"], "profession" => $row["parent2profession"], "employer" => $row["parent2employer"], "parent2fields" => $row["parent2fields"]);
         $sql = "INSERT INTO gibbonPerson SET username=:username, password='', passwordStrong=:passwordStrong, passwordStrongSalt=:passwordStrongSalt, gibbonRoleIDPrimary='004', gibbonRoleIDAll='004', status='Full', title=:title, surname=:surname, firstName=:firstName, preferredName=:preferredName, officialName=:officialName, nameInCharacters=:nameInCharacters, gender=:gender, languageFirst=:parent2languageFirst, languageSecond=:parent2languageSecond, citizenship1=:citizenship1, nationalIDCardNumber=:nationalIDCardNumber, residencyStatus=:residencyStatus, visaExpiryDate=:visaExpiryDate, email=:email, phone1Type=:phone1Type, phone1CountryCode=:phone1CountryCode, phone1=:phone1, phone2Type=:phone2Type, phone2CountryCode=:phone2CountryCode, phone2=:phone2, profession=:profession, employer=:employer, fields=:parent2fields";
         $result = $connection2->prepare($sql);
         $result->execute($data);
     } catch (PDOException $e) {
         $insertOK = false;
         print "<div class='error'>" . $e->getMessage() . "</div>";
     }
     if ($insertOK == true) {
         $failParent2 = FALSE;
開發者ID:dpredster,項目名稱:core,代碼行數:31,代碼來源:applicationForm_manage_accept.php

示例6: randomPassword

$user = $_SESSION['user'];
function randomPassword()
{
    // Courtesy of Neil from StackOverflow
    $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ";
    $pass = array();
    $alphaLength = strlen($alphabet) - 1;
    for ($i = 0; $i < 8; $i++) {
        $n = rand(0, $alphaLength);
        $pass[] = $alphabet[$n];
    }
    return implode($pass);
}
$passQry = "SELECT pass FROM `players` WHERE username = '{$user}'";
if (!mysqli_query($link, $passQry)) {
    $pass = randomPassword();
    if (!isset($_SESSION['pass'])) {
        $_SESSION['pass'] = $pass;
    }
} else {
    $result = mysqli_query($link, $passQry);
    $r = mysqli_fetch_array($result);
    $pass = $r['pass'];
    if (!isset($_SESSION['pass'])) {
        $_SESSION['pass'] = $pass;
    }
}
$tz = $_SESSION['tz'];
$plyQry = "SELECT * FROM `players` WHERE username = '{$user}'";
$result = mysqli_query($link, $plyQry);
$r2 = mysqli_fetch_array($result);
開發者ID:navybofus,項目名稱:SlavehackLegacy,代碼行數:31,代碼來源:index.php

示例7: randomPassword

function randomPassword()
{
    global $wpdb;
    $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
    $pass = array();
    //remember to declare $pass as an array
    $alphaLength = strlen($alphabet) - 1;
    //put the length -1 in cache
    for ($i = 0; $i < 10; $i++) {
        $n = rand(0, $alphaLength);
        $pass[] = $alphabet[$n];
    }
    $pass = implode($pass);
    $query = $wpdb->query("select * from `" . $wpdb->prefix . "optins` where `unique_id` = '" . $pass . "' || `optin_unique` == '" . $pass . "'");
    if ($query) {
        randomPassword();
    } else {
        return $pass;
    }
}
開發者ID:aakashwt,項目名稱:wp-plugin,代碼行數:20,代碼來源:social-funnel.php

示例8: randomPassword

<?php

require_once "core/util.php";
$randomStr = randomPassword(16);
setcookie("xsrftoken", $randomStr, time() + 86400 * 30, "/");
// 86400 = 1 day
?>
<!DOCTYPE html>
<!-- saved from url=(0049)http://foundation.zurb.com/templates/sidebar.html -->
<html class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" lang="en" data-useragent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2209.0 Safari/537.36"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple LDAP Manager</title>
<meta name="description" content="LDAP Self-Service Tool, used internally at Lucid Software">
<meta name="author" content="Naysayers">
<link rel="stylesheet" href="css/foundation.css">
<script src="js/vendor/modernizr.js"></script>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/jquery.dataTables.min.css">
<link rel="stylesheet" href="css/dataTables.foundation.css">
<meta class="foundation-data-attribute-namespace"><meta class="foundation-mq-xxlarge"><meta class="foundation-mq-xlarge-only"><meta class="foundation-mq-xlarge"><meta class="foundation-mq-large-only"><meta class="foundation-mq-large"><meta class="foundation-mq-medium-only"><meta class="foundation-mq-medium"><meta class="foundation-mq-small-only"><meta class="foundation-mq-small"><style></style><meta class="foundation-mq-topbar"></head>
<body>
<?php 
include "topnav.phtml";
?>
<div>
  <div id="notify" class = "row">
   
  </div>
  <div class = "large-12 small-12 columns" style="width:100%; height:100%;display:table">
  <div class="row" >
開發者ID:pauldraper,項目名稱:simple-ldap-manager,代碼行數:31,代碼來源:admin-ss.php

示例9: addCacheToCacheCandidate

function addCacheToCacheCandidate($cacheId, $ptId)
{
    $linkCode = randomPassword(50);
    $q = "INSERT INTO `PowerTrail_cacheCandidate`(`PowerTrailId`, `cacheId`, `link`, `date`) VALUES (:1,:2,:3,NOW())";
    $db = \lib\Database\DataBaseSingleton::Instance();
    $db->multiVariableQuery($q, $ptId, $cacheId, $linkCode);
    require_once 'sendEmailCacheCandidate.php';
    emailCacheOwner($ptId, $cacheId, $linkCode);
    print 'cache added as cache candidate';
    exit;
}
開發者ID:pawelzielak,項目名稱:opencaching-pl,代碼行數:11,代碼來源:ajaxAddCacheToPt.php

示例10: mysql_query

					<?php 
// add user
$checkfitbitid = mysql_query("SELECT * FROM users WHERE FitbitID = '" . $xml->user->encodedId . "'");
if (mysql_num_rows($checkfitbitid) == 1) {
    $UsernameQuery = mysql_query("SELECT `IFTTTUsername` FROM `users` WHERE `FitbitID` LIKE '" . $xml->user->encodedId . "'");
    $PasswordQuery = mysql_query("SELECT `IFTTTPassword` FROM `users` WHERE `FitbitID` LIKE '" . $xml->user->encodedId . "'");
    echo "<h1>Welcome Back " . $xml->user->displayName . "</h1>";
    echo "<p>Below are your IFTTT wordpress details:</p>";
    echo "<p>Blog URL:<code>" . $iftttBlogUrl . "</code></p>";
    echo "<p>Username:<code>" . mysql_result($UsernameQuery, 0) . "</code></p>";
    echo "<p>Password:<code>" . mysql_result($PasswordQuery, 0) . "</code></p>";
    echo '<p><a href="' . $iftttBlogUrl . '/logout.php">Logout</a></p>';
} else {
    $IFTTTPassword = randomPassword();
    while (true) {
        $IFTTTUsername = randomPassword();
        $IFTTTUsernameCheckQuery = mysql_query("SELECT `IFTTTUsername` FROM `users` WHERE `IFTTTUsername` = '" . $IFTTTUsername . "'");
        if (mysql_num_rows($IFTTTUsernameCheckQuery) < 1) {
            break;
        }
    }
    $registerquery = mysql_query("INSERT INTO users (`FitbitID`, `FitbitName`, `FitbitAvatar`, `IFTTTUsername`, `IFTTTPassword`,`FitBitToken`,`FitBitSecret`) VALUES('" . $xml->user->encodedId . "', '" . $xml->user->displayName . "','" . $xml->user->avatar . "','" . $IFTTTUsername . "','" . $IFTTTPassword . "','" . $_SESSION['token'] . "', '" . $_SESSION['secret'] . "')");
    if ($registerquery) {
        echo "<h1>Welcome " . $xml->user->displayName . "</h1>";
        echo "<p>Your account was successfully created.</p>";
        echo "<p>Below are your IFTTT wordpress details:</p>";
        echo "<p>Blog URL:<code>" . $iftttBlogUrl . "</code></p>";
        echo "<p>Username:<code>" . $IFTTTUsername . "</code></p>";
        echo "<p>Password:<code>" . $IFTTTPassword . "</code></p>";
        echo '<p><a href="' . $iftttBlogUrl . '/logout.php">Logout</a></p>';
        //create table for user activities
開發者ID:jamesmstone,項目名稱:OUTDATED-ifttt-fitbit,代碼行數:31,代碼來源:settings.php

示例11: createUser

 public function createUser()
 {
     $user = new User();
     $password = randomPassword();
     $email = Input::get('email');
     $user->username = Input::get('username');
     $user->email = Input::get('email');
     $user->password = $password;
     $user->password_confirmation = $password;
     $user->partner_id = Auth::user()->id;
     $user->save();
     $data = array('password' => $password, 'email' => $user->email);
     Mail::send('emails.pcreate', $data, function ($message) use($email) {
         $message->from('info@festic.be', 'festic');
         $message->to($email);
     });
     return Redirect::to('users')->with('message', 'Account created');
 }
開發者ID:axelardu,項目名稱:festic-partner,代碼行數:18,代碼來源:PartnerController.php

示例12: randomPassword

            //Set the user's new password
            $req = "UPDATE `Users` SET  `password` = '{$password}' WHERE `email` = '{$email2}'";
            $result = $conn->query($req);
            //Set the key to expired
            $req = "UPDATE `LostPassword` SET `Expiry`=0 WHERE `Code` = '{$key}'";
            $result = $conn->query($req);
            echo "<div class=\"alert alert-success\" role=\"alert\">Your new password has been sent to your email, you may now login using it.</div>";
        } else {
            echo "<div class=\"alert alert-danger\" role=\"alert\">The key you have does not exist or is expired, if you think this is an error please email support@mmsquiz.com.</div>";
        }
        $conn->close();
    }
}
//Entered email for password recovery
if ($email != '') {
    $key = randomPassword(32);
    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);
    // Check connection
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    $req = "SELECT * FROM `Users` WHERE `email` = '{$email}'";
    $result = $conn->query($req);
    if ($result->num_rows > 0) {
        //INSERT KEY
        $expire = time() + 3600;
        $req = "INSERT INTO `LostPassword`(`Email`, `Code`, `Expiry`) VALUES ('{$email}','{$key}', {$expire})";
        $result = $conn->query($req);
        //SEND Them KEY to unlock
        $to = $email;
開發者ID:kjleonard,項目名稱:TechEx_KyleLeonard,代碼行數:31,代碼來源:lostpassword.php

示例13: randomPassword

								<div class="col-md-6 inputGroupContainer">
									<div class="input-group">
									<input type="text" name="id_psn" id="id_psn" class="form-control" value="<?php 
echo $NoUrut;
?>
" placeholder="ID Pasien..">
									<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
									</div>
								</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">Kata Sandi</label>
								<div class="col-md-6 inputGroupContainer">
									<div class="input-group">
									<input type="text" name="pass_psn" id="pass_psn" class="form-control" value="<?php 
echo randomPassword();
?>
" placeholder="Kata Sandi..">
									<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
									</div>
								</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label" id="captchaOperation"></label>
								<div class="col-md-3 inputGroupContainer">
									<input type="text" class="form-control" name="captcha" />
								</div>
						</div>
						<div class="form-group">
							<div class="col-md-offset-3 col-md-9">
								<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-log-in"></span>&nbsp Daftar</button>
開發者ID:erikodiony,項目名稱:Puskesmas,代碼行數:31,代碼來源:Index.php

示例14: srand

    // function untuk membuat password random 6 digit karakter
    $digit = 6;
    $karakter = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
    srand((double) microtime() * 1000000);
    $i = 0;
    $pass = "";
    while ($i <= $digit - 1) {
        $num = rand() % 32;
        $tmp = substr($karakter, $num, 1);
        $pass = $pass . $tmp;
        $i++;
    }
    return $pass;
}
// membuat password baru secara random -> memanggil function randomPassword
$newPassword = randomPassword();
// perlu dibuat sebarang pengacak
$pengacak = "AJWKXLAJSCLWLW";
// mengenkripsi password dengan md5() dan pengacak
$newPasswordEnkrip = md5($pengacak . md5($newPassword) . $pengacak);
// membuat password baru secara random -> memanggil function randomPassword
$isi_pesan = "Username : {$username}, Pass :{$newPassword}";
$masuk = mysql_query("insert into outbox (InsertIntoDB,SendingDateTime,DestinationNumber,TextDecoded,SendingTimeOut,DeliveryReport,CreatorID)\n\t\tvalues (sysdate(),sysdate(),'{$nohp}','{$isi_pesan}',sysdate(),'yes','system')");
if ($masuk) {
    $edituser = mysql_query("UPDATE user SET\n\t\t\t\t\t\t\tpassword='{$newPasswordEnkrip}'\n                                                        \n                                                        \tWHERE iduser='{$id}'");
    if ($edituser) {
        echo "<h4> Simpan Password baru berhasil </h4>";
    } else {
        echo "<h4> Simpan Password baru gagal </h4>";
    }
    echo "<h4> Pesan Dikirim Ke No HP anda {$nohp} </h4><br/>";
開發者ID:ali-ghanas,項目名稱:sitampan,代碼行數:31,代碼來源:kirimpass.php

示例15: if

 <?php  
} 
}
 ?>
 </form>

 
 <!--<div class="bkgd-stripes-orange">&nbsp;</div>-->
 <div class="inPageCartBlock" style="color:#5C5C5C;font-weight:bold;font-size:18px;margin-top:10px;padding-right:0px;">

 Current Order Total : $<span id="" class="total_order" style="font-size: 18px;font-weight:bold;"><?php if($_SESSION['session_order'] == ''){if($_GET['sub'] !=''){ echo $_GET['sub'];}else{ ?><?php if($_REQUEST['all_total'] != ''){echo number_format($_REQUEST['all_total'], 2, '.','');}else{ ?>0.00<?php } } }else{echo number_format($_SESSION['session_order'], 2, '.','');}?></span>
     <input type="hidden" class="total_order_txt" id="total_order_val" name="all_total" value="<?php if($_SESSION['session_order'] == ''){echo ($_GET['sub'] != '') ? $_GET['sub'] : $_REQUEST['all_total'];}else{echo number_format($_SESSION['session_order'], 2, '.','');} ?>"/>
 
 </div>
 <?php $select_customer = SupplyCustomer(); 
       $supply_usr_rand =randomPassword(); 
       $sele_usr_conti_shop = SupplyUsrContShopp($_SESSION['supply_comp_id'],$_SESSION['supply_usr_id']);
       $state_all = StateAll();
 ?>
 <input type="hidden" id="supply_usr_rand" name="supply_usr_rand" value="<?php echo $supply_usr_rand; ?>" />
 <input type="hidden" id="usr_id" name="usr_id" value="<?php echo $_GET['usr_id']; ?>" />
 <input type="hidden" id="new_user_session" name="new_user_session" value="<?php echo $_SESSION['new_user_session']; ?>" />
 <!--<div style="margin-bottom:0;" class="bkgd-stripes-orange">&nbsp;</div>-->
 <div style="clear:both;"></div>
 <div id="login_window">    	
        <div class="close"></div>
       	<span class="ecs_tooltip">Press Esc to close <span class="arrow"></span></span>
        <div id="popup_content" class="supply_login"> <!--your content start-->
                <h1>Select Customer</h1>
                <span id="alert_msg" style="color:#FF0000;font-size: 12px;"></span>
                <ul>
開發者ID:njassim,項目名稱:SOHO_REPRO,代碼行數:31,代碼來源:supply_store.php


注:本文中的randomPassword函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。