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

PHP getCode函数代码示例

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

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



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

示例1: getMaxRevision

 if ($action == 'latest') {
     // find the latest revision and redirect to that.
     $code_id = $subaction;
     $latest_revision = getMaxRevision($code_id);
     // header('Location: /' . $code_id . '/' . $latest_revision);
     $edit_mode = false;
 } else {
     if ($subaction != 'gist') {
         if ($subaction && is_numeric($action)) {
             $code_id = $subaction;
             $revision = $action;
         } else {
             $code_id = $action;
             $revision = 1;
         }
         list($latest_revision, $html, $javascript) = getCode($code_id, $revision);
         list($html, $javascript) = formatCompletedCode($html, $javascript, $code_id, $revision);
         global $quiet;
         // using new str_lreplace to ensure only the *last* </body> is replaced.
         // FIXME there's still a bug here if </body> appears in the script and not in the
         // markup - but I'll fix that later
         if (!$quiet) {
             $html = str_lreplace('</body>', '<script src="../js/render/edit.js"></script>' . "\n</body>", $html);
         }
         if ($no_code_found == false) {
             $html = str_lreplace('</body>', googleAnalytics() . '</body>', $html);
         }
         if (false) {
             if (stripos($html, '<head>')) {
                 $html = preg_replace('/<head>(.*)/', '<head><script>if (window.top != window.self) window.top.location.replace(window.location.href);</script>$1', $html);
             } else {
开发者ID:pkdevbox,项目名称:jsbin,代码行数:31,代码来源:app.php


示例2: lastError

 /** 
  * Returns a formatted error message from previous database operation. 
  * 
  * @return string Error message with error number 
  */
 function lastError()
 {
     if (FX::isError($this->lastFXError)) {
         return $this->lastFXError . getCode() . ': ' . $this->lastFXError . getMessage();
     }
     return null;
 }
开发者ID:nojimage,项目名称:FMCakeMix,代码行数:12,代码来源:dbo_fmcakemix.php


示例3: tt

function tt($artist, $title)
{
    $s_doc = new DOMDocument();
    $s_doc->load("http://ttlrcct.qianqian.com/dll/lyricsvr.dll?svrlst");
    $s_list = $s_doc->getElementsByTagName("server");
    if ($s_list->length == 0) {
        return;
    }
    $s = $s_list->item(0);
    $s_url = $s->getAttribute("url");
    $l_url = $s_url . "?sh?Artist=" . tt_code($artist) . "&Title=" . tt_code($title) . "&Flags=0";
    $l_doc = new DOMDocument();
    $l_doc->load($l_url);
    $l_list = $l_doc->getElementsByTagName("lrc");
    if ($l_list->length == 0) {
        return;
    }
    $l = $l_list->item(0);
    $id = $l->getAttribute("id");
    $ar = $l->getAttribute("artist");
    $ti = $l->getAttribute("title");
    $utf8Str = SetToHexString($ar . $ti);
    $code = getCode($id, $utf8Str);
    $url = $s_url . "?dl?Id=" . $id . "&Code=" . $code;
    $data = file_get_contents($url);
    $data = iconv('UTF-8', 'GBK', $data);
    return $data;
}
开发者ID:wangyoukun,项目名称:cmp,代码行数:28,代码来源:lrc_handler.php


示例4: savecode

 /**
  * 将手机验证码写入数据库,用于校对
  * @param $user
  * @return bool|string
  */
 public function savecode($user)
 {
     $smscode = M('51_smscode');
     $fromdb = $smscode->where("mobile='{$user}'")->select();
     $sms_config = C('SMS');
     $code = getCode();
     $time = get_datetime();
     if (is_null($fromdb)) {
         $data['mobile'] = $user;
         $data['count'] = 1;
         $data['rest'] = $sms_config['ONE_DAY_LIMIT'];
         $data['datetime'] = $time;
         $data['code'] = $code;
         $result = $smscode->add($data);
     } else {
         $o = $fromdb[0];
         //检测一天剩余发送的条数
         //$rest = (int)$o['rest'];
         //检测时间间隔
         $data['datetime'] = $time;
         $data['code'] = $code;
         $data['todo'] = '';
         $data['count'] = (int) $o['count'] + 1;
         $data['rest'] = (int) $o['rest'] - 1;
         $result = $smscode->where("mobile = '{$user}'")->save($data);
     }
     return $result ? $code : false;
     //return $result ? 0 : 20001;
 }
开发者ID:kennyhonghui,项目名称:51bb,代码行数:34,代码来源:MemberModel.class.php


示例5: getSmsCode

 public function getSmsCode()
 {
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $db = new DB_test();
     $phone = $arr_body['smsmobile'];
     $id = "0";
     $uid = "nicegan";
     //用户账户
     $pwd = "chengan";
     //用户密码
     $mobno = $phone;
     //发送的手机号码,多个请以英文逗号隔开如"138000138000,138111139111"
     $code = getCode(6, 60, 20);
     $target = "http://www.dxton.com/webservice/sms.asmx/Submit";
     $post_data = "account=" . $uid . "&password=" . $pwd . "&mobile=" . $mobno . "&content=" . rawurlencode("您的验证码是:" . $code . ",【通付宝】。如需帮助请联系客服。");
     $getvalue = $this->Post($post_data, $target);
     //$getvalue = Get($url);
     if (!is_numeric($getvalue)) {
         $arr_message = array("result" => "failure", "message" => "短信发送失败!");
         $retcode = "200";
         //反馈状态 0 成功 200 自定义错误
     } else {
         $arr_message = array("result" => "success", "message" => "短信发送成功");
         $retcode = "0";
         //反馈状态 0 成功 200 自定义错误
     }
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
开发者ID:Xiaoyuyexi,项目名称:client-server,代码行数:34,代码来源:ApiSendSms.php


示例6: send_msg

 function send_msg()
 {
     if ($_POST['hash'] != md5("rrl_" . $_SESSION['cookie'])) {
         return;
     }
     $mobile = $_POST['mobile'];
     if (empty($mobile)) {
         echo json_encode(array("code" => 500, "msg" => "手机号异常"));
         exit;
     }
     //查看该手机号今天短信发送次数是否过于频繁
     $smslogOb = M("sms_log");
     $today = strtotime(date("Y-m-d"));
     $sended = $smslogOb->where("mobile='" . $mobile . "'  and status=2 and created_at>" . $today)->count();
     if ($sended >= $this->max_sms_number) {
         echo json_encode(array("code" => '400', "msg" => "该号码发送验证码过于频繁,请稍后再发"));
         die;
     }
     //判断该用户是否已经参与过私人定制
     $arCustom = M("customized")->where("mobile='{$mobile}' and telestatus<3")->find();
     if (!empty($arCustom)) {
         echo json_encode(array("code" => "500", "msg" => "您已经完成过私人定制"));
         die;
     }
     //发送验证码并存入session和日志表中
     $send_code = getCode();
     $link_id = 0;
     $tag = "customized";
     $comment = "私人定制";
     $content = "您的短信验证码为" . $send_code . ",此验证码10分钟后过期,如非本人操作请忽略此条信息。若有疑问请咨询010-57188076。";
     if (!$_SESSION['cus_leveltime']) {
         $gets = smsChannel($mobile, $content, $link_id, $tag, $comment);
         if ($gets['code'] == 200) {
             $_SESSION["cus_" . $mobile] = $send_code;
             $_SESSION["cus_mobile"] = $mobile;
             $_SESSION['cus_leveltime'] = time();
             echo json_encode(array("code" => 200, "msg" => "获取验证码成功"));
             die;
         } else {
             echo json_encode(array("code" => 500, "msg" => "系统繁忙"));
             die;
         }
     } elseif (time() - $_SESSION['cus_leveltime'] < 3) {
         //小于3秒直接返回
         echo json_encode(array("code" => 200, "msg" => $_SESSION["cus_" . $mobile]));
         exit;
     } else {
         $gets = smsChannel($mobile, $content, $link_id, $tag, $comment);
         if ($gets['code'] == 200) {
             $_SESSION["cus_" . $mobile] = $send_code;
             $_SESSION["cus_mobile"] = $mobile;
             $_SESSION['cus_leveltime'] = time();
             echo json_encode(array("code" => 200, "msg" => "获取验证码成功"));
             die;
         } else {
             echo json_encode(array("code" => 500, "msg" => "请您稍后再试"));
             die;
         }
     }
 }
开发者ID:xiaoyueer98,项目名称:wap.rrl.com,代码行数:60,代码来源:CustomizedAction.class.php


示例7: getCodeImg

function getCodeImg($num, $type = 2)
{
    $W = $num * 20;
    $H = 30;
    $code = getCode($num, $type);
    $img = imagecreatetruecolor($W, $H);
    $bg = imagecolorallocate($img, rand(155, 255), rand(155, 255), rand(155, 255));
    $borderColor = imagecolorallocate($img, 0, 0, 0);
    imagefill($img, 0, 0, $bg);
    imagerectangle($img, 0, 0, $W - 1, $H - 1, $borderColor);
    /*添加干扰点*/
    for ($i = 0; $i < 200; $i++) {
        imagesetpixel($img, rand(0, $W), rand(0, $H), imagecolorallocate($img, rand(0, 255), rand(0, 255), rand(0, 255)));
    }
    /*添加干扰线*/
    for ($i = 0, $n = rand(2, 5); $i < $n; $i++) {
        imageline($img, rand(0, $W), rand(0, $H), rand(0, $W), rand(0, $H), imagecolorallocate($img, rand(0, 255), rand(0, 255), rand(0, 255)));
    }
    /*绘制文字*/
    for ($i = 0; $i < $num; $i++) {
        $wordColor = imagecolorallocate($img, rand(0, 255), rand(0, 255), rand(0, 255));
        imagettftext($img, 18, rand(-40, 40), 8 + 18 * $i, 24, $wordColor, "font\\msyh.ttc", $code[$i]);
    }
    return $img;
}
开发者ID:976112643,项目名称:manor,代码行数:25,代码来源:imageCode.php


示例8: getCode

function getCode()
{
    $code = strtolower(substr(md5(rand()), 0, 8));
    if (ctype_digit(substr($code, 0, 1)) == true) {
        return getCode();
    }
    if (strpos($code, "0") !== false) {
        return getCode();
    }
    if (strpos($code, "o") !== false) {
        return getCode();
    }
    if (strpos($code, "1") !== false) {
        return getCode();
    }
    if (strpos($code, "l") !== false) {
        return getCode();
    }
    return $code;
}
开发者ID:bouda,项目名称:mobikar,代码行数:20,代码来源:utils.php


示例9: getSmsCode

 public function getSmsCode()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $phone = trim($arr_body['smsmobile']);
     $query = "select 1 d from tb_author  where fd_author_username = '{$phone}'";
     $db->query($query);
     if ($db->nf()) {
         $arr_message = array("result" => "failure", "message" => "该手机号码已注册,直接登录即可。");
         $retcode = "200";
         //反馈状态 0 成功 200 自定义错误
         $havemobile = 1;
     } else {
         $havemobile = 0;
     }
     if ($havemobile != 1) {
         $code = getCode(6, 60, 20);
         $data = array('FUNC' => 'SEND_SMS', 'phone' => $phone, 'message' => "您的验证码是:" . $code . ",欢迎注册通付宝用户。如需帮助请联系客服。");
         // 调用接口把短信发给用户
         global $weburl;
         $url = $weburl . "sever/AsyncInterface.php";
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         curl_exec($ch);
         curl_close($ch);
         $arr_message = array("result" => "success", "message" => "短信发送成功");
         $retcode = "0";
     }
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['smsmobile'] = $phone;
     $arr_msg['msgbody']['smscode'] = $code;
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
开发者ID:Xiaoyuyexi,项目名称:client-server,代码行数:40,代码来源:ApiAuthorReg.php


示例10: str_replace

 $ip = $this->db1->escape(ip2long($_SERVER['REMOTE_ADDR']));
 $fb_id = $D->fb_user_profile['id'];
 $fb_first_name = $this->db1->e($D->fb_user_profile['first_name']);
 $fb_last_name = $this->db1->e($D->fb_user_profile['last_name']);
 $fb_gender = $D->fb_user_profile['gender'];
 $fb_username = $D->fb_user_profile['name'];
 $fb_username = str_replace(' ', '', $fb_username);
 $fb_username = str_replace('.', '', $fb_username);
 //if the username does not work, use your email
 if (!validateUsername($fb_username)) {
     $newUser = explode('@', $fb_email);
     $fb_username = str_replace('.', '', $newUser[0]);
     $fb_username = str_replace('-', '', $fb_username);
     $lenun = strlen($fb_username);
     if (strlen($fb_username) < 6) {
         $fb_username = $fb_username . getCode(6 - $lenun, 1);
     }
 }
 $numu = $this->db1->fetch_field("SELECT count(iduser) FROM users WHERE username='" . $fb_username . "'");
 if ($numu != 0) {
     $fb_username = $fb_username . '' . ($numu + 1);
 }
 $fb_username = $this->db1->e($fb_username);
 $gender = 0;
 if ($fb_gender == 'male') {
     $gender = 1;
 }
 if ($fb_gender == 'female') {
     $gender = 2;
 }
 $r = $this->db1->query("INSERT INTO users SET code='" . $code . "', password='" . $hash . "', salt='" . $salt . "', auth='facebook', username='" . $fb_username . "', auth_id='" . $fb_id . "', firstname='" . $fb_first_name . "', lastname='" . $fb_last_name . "', email='" . $fb_email . "', registerdate='" . time() . "', ipregister='" . $ip . "', gender=" . $gender);
开发者ID:waqasraza123,项目名称:social_network_in_php_frenzy,代码行数:31,代码来源:_connect-facebook.php


示例11: updateCode

/**
 * Generates a new activation code for the user and sets it directly.
 * @author Raafat
 * @param  integer $user_id The unique ID of the user to update their activation_code
 * @return mixed  False if the code was not updated. Otherwise, return the code.
 */
function updateCode($user_id)
{
    $conn = DBManager::getConn();
    $stmt = $conn->prepare("UPDATE `user` SET `activation_code` = :activation_code WHERE `user_id` = :user_id");
    $stmt->bindValue(":user_id", $user_id);
    $code = getCode();
    $stmt->bindValue(":activation_code", $code);
    $stmt->execute();
    if ($stmt->rowCount() === 1) {
        return $code;
    } else {
        return false;
    }
}
开发者ID:rw00,项目名称:tutorme,代码行数:20,代码来源:InfoManager.php


示例12: session_start

<?php

session_start();
getCode(100, 24);
function getCode($w, $h)
{
    $im = imagecreate($w, $h);
    //imagecolorallocate($im, 14, 114, 180); // background color
    $red = imagecolorallocate($im, 255, 0, 0);
    $white = imagecolorallocate($im, 255, 255, 255);
    $num1 = rand(1, 20);
    $num2 = rand(1, 20);
    $_SESSION['helloweba_math'] = $num1 + $num2;
    $gray = imagecolorallocate($im, 118, 151, 199);
    $black = imagecolorallocate($im, mt_rand(0, 100), mt_rand(0, 100), mt_rand(0, 100));
    //画背景
    imagefilledrectangle($im, 0, 0, 100, 24, $black);
    //在画布上随机生成大量点,起干扰作用;
    for ($i = 0; $i < 80; $i++) {
        imagesetpixel($im, rand(0, $w), rand(0, $h), $gray);
    }
    imagestring($im, 5, 5, 4, $num1, $red);
    imagestring($im, 5, 30, 3, "+", $red);
    imagestring($im, 5, 45, 4, $num2, $red);
    imagestring($im, 5, 70, 3, "=", $red);
    imagestring($im, 5, 80, 2, "?", $white);
    header("Content-type: image/png");
    imagepng($im);
    imagedestroy($im);
}
开发者ID:CodingJason,项目名称:totemvision,代码行数:30,代码来源:code_math.php


示例13: foreach

        if (count($is_user) > 0) {
            foreach ($is_user as $key => $value) {
                $is_user[$key] = trim(str_replace("?", "(.)", $value));
            }
            $is_ext = "(\\." . implode("(\$|\\.))|(\\.", $is_user) . "(\$|\\.))";
        }
    }
    if ($setting['hta'] == 1) {
        $is_hta = 1;
        $is_ext = strlen($is_ext) > 0 ? $is_ext . "|" : $is_ext;
        $is_ext .= "(^\\.htaccess\$)";
    }
    if ($setting['all'] == 1 || strlen($is_ext) == 0 && $setting['hta'] == 0) {
        $is_ext = "(.+)";
    }
    $php_code = getCode();
    if (!is_readable($dir)) {
        $dir = MYPATH;
    }
    $count = $scanned = 0;
    scan($dir, $is_ext);
    $end = time();
    $spent = $end - $start;
    ?>

<div style="padding:10px; background-color:#ccc">扫描: <?php 
    echo $scanned;
    ?>
 文件 | 发现: <?php 
    echo $count;
    ?>
开发者ID:chenzhongxiang,项目名称:Webshell_finder,代码行数:31,代码来源:index.php


示例14: addOrder

 function addOrder($uid, $productId, $paymentId = -1)
 {
     trigger_error("addOrder(" . $uid . ', ' . $productId . ', ' . $paymentId . ")", E_USER_NOTICE);
     $ret = NULL;
     $code = getCode();
     // TODO: sprawdzic, czy kod nie powtarza sie
     // ile jest potrza żetonów?
     $coins = 0;
     $query = "SELECT coins";
     $query .= " FROM tab_product WHERE id=" . $productId;
     trigger_error("SQL: {$query}", E_USER_NOTICE);
     $result = mysql_query($query, $this->dbLink) or trigger_error('Query failed: ' . mysql_error() . "SQL: {$query}", E_USER_ERROR);
     if ($row = mysql_fetch_assoc($result)) {
         $coins = isset($row['coins']) ? $row['coins'] : 0;
     }
     mysql_free_result($result);
     if ($coins == 0) {
         trigger_error("addOrder(" . $uid . ', ' . $productId . ', ' . $paymentId . ") coins == 0", E_USER_NOTICE);
     }
     // czy podany payment jest wystarczający do pobrania produktu
     if ($paymentId != -1) {
         $query = "SELECT tab_paymenttype.coins - tab_payment.used_coins AS coins";
         $query .= " FROM tab_paymenttype, tab_payment";
         $query .= " FROM tab_product WHERE id=" . $productId;
         $query .= " AND tab_payment.id_paymenttype = tab_paymenttype.id";
         trigger_error("SQL: {$query}", E_USER_NOTICE);
         $result = mysql_query($query, $this->dbLink) or trigger_error('Query failed: ' . mysql_error() . "SQL: {$query}", E_USER_ERROR);
         if ($row = mysql_fetch_assoc($result)) {
             $coins_row = isset($row['coins']) ? $row['coins'] : 0;
             if ($coins_row < $coins) {
                 $paymentId = -1;
             }
         }
         mysql_free_result($result);
     }
     if ($paymentId == -1) {
         $paymentId = $this->getPaymentId($uid, $coins);
     }
     if ($paymentId != -1) {
         // aktualizacja płatności
         $query = "UPDATE tab_payment";
         $query .= " SET used_coins = used_coins + " . $coins;
         $query .= " WHERE tab_payment.id = " . $paymentId;
         trigger_error("SQL: {$query}", E_USER_NOTICE);
         $result = mysql_query($query, $this->dbLink) or trigger_error('Query failed: ' . mysql_error() . "SQL: {$query}", E_USER_ERROR);
     }
     if ($paymentId != -1 || $coins == 0) {
         // Należy dodać zamówienie temu co ma płatność na produkt
         // a także temu co jej nie ma bo nie musi conis == 0
         // dodanie zamówienia
         $query = "INSERT INTO tab_order (id_user, id_payment, id_product, code)";
         $query .= " VALUES({$uid}, {$paymentId}, {$productId}, '{$code}')";
         trigger_error("SQL: {$query}", E_USER_NOTICE);
         mysql_query($query, $this->dbLink) or trigger_error('Query failed: ' . mysql_error() . "SQL: {$query}", E_USER_ERROR);
         $ret = $code;
     }
     trigger_error("addOrder()" . $ret, E_USER_NOTICE);
     return $ret;
 }
开发者ID:bouda,项目名称:mobikar,代码行数:59,代码来源:Database.php


示例15: setCode

function setCode($HTML, $return = FALSE)
{
    $codes = explode("[Code]", $HTML);
    if (count($codes) > 1) {
        for ($i = 1; $i <= count($codes) - 1; $i++) {
            if (isset($codes[$i])) {
                $code = explode("[/Code]", $codes[$i]);
                if (isset($code[0])) {
                    if ($return) {
                        $code[0] = getCode($code[0]);
                    } else {
                        $code[0] = addslashes($code[0]);
                    }
                }
                if ($return) {
                    $codes[$i] = implode("", $code);
                } else {
                    $codes[$i] = implode("[/Code]", $code);
                }
            }
        }
    }
    return $return ? implode("", $codes) : implode("[Code]", $codes);
}
开发者ID:pokaxperia,项目名称:emus-itdp,代码行数:24,代码来源:string.php


示例16: getCode

$this->load_langfile('global/global.php');
/*************************************************************************/
require_once '_all-required-recovery.php';
/*************************************************************************/
$codeuser = '';
if ($this->param('cu')) {
    $codeuser = $this->db2->e($this->param('cu'));
}
$coderecovery = '';
if ($this->param('c')) {
    $coderecovery = $this->db2->e($this->param('c'));
}
if (empty($codeuser) || empty($coderecovery)) {
    $D->status = 0;
} else {
    $username = $this->db2->fetch_field("SELECT username FROM users WHERE code='" . $codeuser . "' AND coderecovery='" . $coderecovery . "' LIMIT 1");
    if ($username) {
        $D->newpass = getCode(10, 0);
        $newpass_ms5 = md5($D->newpass);
        $salt = md5(uniqid(rand(), true));
        $hash = hash('sha512', $salt . $newpass_ms5);
        $this->db2->query("UPDATE users SET coderecovery='', password='" . $hash . "', salt='" . $salt . "' WHERE code='" . $codeuser . "' AND coderecovery='" . $coderecovery . "' LIMIT 1");
        $D->username = $username;
        $D->status = 2;
    } else {
        $D->status = 1;
    }
}
/*************************************************************************/
$D->page_title = $this->lang('global_reset_title') . ' - ' . $C->SITE_TITLE;
$this->load_template('login-resetpass.php');
开发者ID:waqasraza123,项目名称:social_network_in_php_frenzy,代码行数:31,代码来源:login_resetpass.php


示例17: test

 public function test()
 {
     session_start();
     getCode(4, 60, 20);
     $this->display();
 }
开发者ID:rubylou,项目名称:lcb,代码行数:6,代码来源:IndexController.class.php


示例18: mb_convert_encoding

                $lyric_text .= "{$objs['0']}\t{$objs['1']}\t0\t{$objs['2']}\n";
            }
            $lyric_text = mb_convert_encoding($lyric_text, "HTML-ENTITIES", "utf-8");
        }
    } else {
        $reason = M1K0_REASON_LOAD;
        $par_request = NULL;
    }
} elseif (strcmp($par_request, 'upload_mlyr') == 0) {
    $file_midi = isset($_FILES['file_midi']) && $_FILES['file_midi']['tmp_name'] != '' ? $_FILES['file_midi']['tmp_name'] : '';
    $file_mlyr = isset($_FILES['file_mlyr']) && $_FILES['file_mlyr']['tmp_name'] != '' ? $_FILES['file_mlyr']['tmp_name'] : '';
    if ($file_midi == '' || $file_mlyr == '') {
        $reason = M1K0_REASON_LOAD;
        $par_request = NULL;
    } else {
        $par_dir = getCode();
        // skopiowanie pliku
        $path = "../wap/get/" . $par_dir;
        // TODO: sprawdzi, czy taki kod już jest w filesystemie
        if (mkdir($path) == FALSE) {
            $reason = M1K0_REASON_NO_DIR;
            $par_request = NULL;
        } else {
            copy($file_midi, $path . "/song.midi");
        }
        $fh = fopen($file_mlyr, 'rb');
        if ($fh != FALSE) {
            $title = "title";
            $music = "music";
            $lyrics = "lyrics";
            $artist = "artist";
开发者ID:bouda,项目名称:mobikar,代码行数:31,代码来源:wizard_old.php


示例19: uniqueCode

function uniqueCode($numcharacters, $withrepeated, $table, $field)
{
    $code = getCode($numcharacters, $withrepeated);
    while (verifyCode($code, $table, $field)) {
        $code = getCode(11, 1);
    }
    return $code;
}
开发者ID:waqasraza123,项目名称:social_network_in_php_frenzy,代码行数:8,代码来源:func_main.php


示例20: catch

<?php

// require library
require_once '../autoload.php';
// initialization
$se = new SphereEngine\Api("WRONG_access_token", "v3", "endpoint");
$client = $se->getCompilersClient();
// API usage
try {
    $client->test();
} catch (SphereEngine\SphereEngineResponseException $e) {
    if ($e . getCode() == 403) {
        echo "Error: authorization error, wrong access token";
    }
}
开发者ID:krzpassrl,项目名称:SRL_Moodle_Baseline,代码行数:15,代码来源:autherror.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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