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

PHP generate函数代码示例

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

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



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

示例1: login

function login($email, $password)
{
    $db = Database::getInstance();
    $mysqli = $db->getConnection();
    $mysqli->query("SET NAMES utf8");
    $sql_query = 'SELECT * FROM user WHERE email="' . $email . '"';
    $result = $mysqli->query($sql_query);
    $user = mysqli_fetch_assoc($result);
    global $password;
    //if password correct
    if (password_verify($password, $user['password'])) {
        session_start();
        $_SESSION['auth'] = true;
        $_SESSION['id'] = $user['id'];
        $_SESSION['user'] = $user['user'];
        //check keep login, set coockie
        if ($_POST['loginkeeping'] == "on") {
            $key = md5(generate(7, 15));
            setcookie('login', $user['user'], time() + 60 * 60 * 24 * 365);
            setcookie('key', $key, time() + 60 * 60 * 24 * 365);
            $sql_query = "UPDATE user SET cookie='" . $key . "' WHERE id='" . $user['id'] . "'";
            $mysqli->query($sql_query);
            //if no keep login, set cookie as NULL
        } else {
            $sql_query = "UPDATE user SET cookie=NULL WHERE id='" . $user['id'] . "'";
            $mysqli->query($sql_query);
        }
        header("Location: http://" . $_SERVER['SERVER_NAME']);
    } else {
        echo "Email or password is incorrect";
    }
}
开发者ID:Hydropericardium,项目名称:blog.dev,代码行数:32,代码来源:generate.php


示例2: __toString

 public function __toString()
 {
     if (!isset($this->style)) {
         $this->style = 1;
     }
     return generate($this->style);
 }
开发者ID:thomasmrln,项目名称:sheeter,代码行数:7,代码来源:Sheeter.php


示例3: login

function login($link, $email, $password)
{
    $password = generate($password);
    $query = mysqli_query($connection, "SELECT `user_name`, `user_password` FROM `members` WHERE `user_name` = '{$username}' AND `user_password` = '{$password}'");
    $count = mysqli_num_rows($query);
    //counting the number of returns
    //if the $count = 1 or more return true else return false
    if ($count >= 1) {
        return true;
    } else {
        return false;
    }
}
开发者ID:AoifeNiD,项目名称:phpNightmareChanged,代码行数:13,代码来源:user1.inc.php


示例4: generate

/**
 * This file is part of the magento-sample project
 *
 * (c) Sergey Kolodyazhnyy <[email protected]>
 *
 */
function generate($folder)
{
    $entries = array();
    /** @var SplFileInfo[] $iterator */
    $iterator = new FilesystemIterator($folder, FilesystemIterator::SKIP_DOTS);
    foreach ($iterator as $entry) {
        if (is_file($entry)) {
            $entries[$entry->getPathname()] = $entry->getPathname();
        } else {
            $entries += generate($entry);
        }
    }
    return $entries;
}
开发者ID:bcncommerce,项目名称:magento-sample,代码行数:20,代码来源:modman.php


示例5: test

function test($freq, $prn = false)
{
    global $fs, $filter;
    $data = generate($freq, 0.1, $fs);
    $res = filter($data, $filter);
    if ($prn) {
        for ($i = 0; $i < count($data); $i++) {
            echo "{$data[$i]}\t{$res[$i]}\n";
        }
    }
    $aIn = amplitude($data);
    $aOut = amplitude($res);
    return $aOut / $aIn;
}
开发者ID:RodionGork,项目名称:MusicBlinker,代码行数:14,代码来源:calculations.php


示例6: generate

function generate($srcPath, $dstPath = 'doc/', $imports = array())
{
    global $hide;
    if (!file_exists($dstPath)) {
        mkdir($dstPath, 0777, true);
    }
    $menu = "";
    #collect imports
    foreach (glob($srcPath . "*.hx") as $fname) {
        $import = str_replace(SRC_ROOT, '', $fname);
        $import = str_replace(DOC_ROOT, '', $fname);
        $import = preg_replace('/(\\.\\/)|(\\.\\/)/', '', $import);
        $import = preg_replace('/\\//', '.', $import);
        $import = preg_replace('/^([^a-zA-Z]*)/', '', $import);
        $import = preg_replace('/\\.hx$/', '', $import);
        $imports[basename($fname, '.hx')] = $import;
    }
    #process files
    foreach (glob($srcPath . "*.hx") as $fname) {
        $import = str_replace(SRC_ROOT, '', $fname);
        $import = str_replace(DOC_ROOT, '', $fname);
        $import = preg_replace('/(\\.\\/)|(\\.\\/)/', '', $import);
        $import = preg_replace('/\\//', '.', $import);
        $import = preg_replace('/^([^a-zA-Z]*)/', '', $import);
        $import = preg_replace('/\\.hx$/', '', $import);
        $skip = false;
        foreach ($hide as $ignore) {
            if (strpos($import, $ignore) !== false) {
                $skip = true;
                break;
            }
        }
        if ($skip) {
            continue;
        }
        $menu .= "<li class=\"class\"><a href=\"" . url($import) . "\" class=\"class\">" . basename($fname, '.hx') . "</a></li>\n";
        $doc = genDoc($fname, $imports);
        file_put_contents($dstPath . basename($fname, '.hx') . '.html', $doc);
    }
    #process dirs
    foreach (glob($srcPath . "*", GLOB_ONLYDIR) as $dirName) {
        $menu = "<li class=\"package\"><span class=\"package\">" . basename($dirName) . "</span>\n<ul>\n" . generate($dirName . '/', $dstPath . basename($dirName) . '/', $imports) . "</ul>\n</li>\n" . $menu;
    }
    return $menu;
}
开发者ID:devsaurin,项目名称:StablexUI,代码行数:45,代码来源:doc.php


示例7: onkernelRequest

 public function onkernelRequest(GetResponseEvent $event)
 {
     //recuperation de la route courante
     $route = $event->getRequest()->attributes->get('_route');
     //on verifie a chaque renouvellement de route si on est pas dans les deux cas ci-dessous
     if ($route == 'aye_creche_livraison' || $route == 'aye_creche_validation') {
         //si c'est la cas on verifie qu'on a plus d'un article dans notre panier
         if ($this->session->has('panier')) {
             if (count($this->session->get('panier')) == 0) {
                 $event->setResponse(new RedirectResponse($this->router - generate('panier')));
             }
         }
         //on verifier bien que l'utilisateur est connecté  sinon on redirige dans la page de login avec le message flash
         if (!is_object($this->securityContext->getToken()->getUser())) {
             $this->session->getFlashBag()->add('notification', 'Vous devez vous identifier afin de finaliser votre achat');
             $event->setResponse(new RedirectResponse($this->router->generate('fos_user_security_login')));
         }
     }
 }
开发者ID:arnodinho,项目名称:symfony2,代码行数:19,代码来源:RedirectionListener.php


示例8: array_values

$lyrics = array_values($lyrics);
$names = scandir('names');
$names = array_diff($names, array('.', '..', '.DS_Store'));
$names = array_values($names);
if (isset($_POST['name']) and $_POST['lyrics']) {
    function generate($length = 5)
    {
        $chars = 'abdefhiknrstyz23456789';
        $numChars = strlen($chars);
        $string = '';
        for ($i = 0; $i < $length; $i++) {
            $string .= substr($chars, rand(1, $numChars) - 1, 1);
        }
        return $string;
    }
    $file = generate(5);
    $file .= '.txt';
    $names[] = $file;
    $handle = fopen('names/' . $file, 'x');
    fwrite($handle, trim($_POST['name']));
    fclose($handle);
    $lyrics[] = $file;
    $handle = fopen('lyrics/' . $file, 'x');
    fwrite($handle, $_POST['lyrics']);
    fclose($handle);
    array_values($names);
    array_values($lyrics);
    header('location: .');
}
if (isset($_POST['rename']) and $_POST['relyrics']) {
    $i = $_POST['i'];
开发者ID:agolomazov,项目名称:test,代码行数:31,代码来源:index.php


示例9: fopen

if (count($argv) == 8) {
    $fpopsperq = $argv[7];
}
$every = 1;
if (count($argv) == 9) {
    $every = $argv[8];
}
echo "generating work for {$name} from {$start} to {$end}, count = {$count}\n";
@unlink("createWorkScript");
$f = fopen("createWorkScript", "wb");
$wus = 0;
for ($i = $start, $loop = 0; $i < $end; $i += $count, $loop++) {
    if ($loop % $every != 0) {
        continue;
    }
    $wun = generate($input, $name, $i, $count, $dir);
    $cw = "";
    $cw .= "mv {$dir}/{$wun} `bin/dir_hier_path {$wun}`\n";
    $cw .= "bin/create_work ";
    $cw .= " --appname gnfslasieve4I1" . $ver . "e ";
    $cw .= " --wu_name {$wun} ";
    $cw .= " --wu_template templates/gnfslasieve4I1Xe_wu.xml ";
    $cw .= " --result_template templates/gnfslasieve4I1Xe_result.xml ";
    $cw .= " --rsc_fpops_est " . $fpopsperq * $count;
    $cw .= " --rsc_fpops_bound " . $fpopsperq * $count * 10;
    $cw .= " {$wun}\n";
    fwrite($f, $cw);
    $wus++;
}
fwrite($f, "rm createWorkScript\n");
fclose($f);
开发者ID:KarimAlloula,项目名称:cloud-and-control,代码行数:31,代码来源:gengnfswu.php


示例10: decode

    }
    ?>
<script>document.getElementById('info').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div> 
<?php 
    $decode = decode($pwid[1]);
    $va = explode('/', $decode);
    if (!empty($va[2]) && !empty($va[4])) {
        $uid = $va[2];
        $upas = $va[4];
    } else {
        html_error('Error get User ID and/or User Password.');
    }
    $Url = parse_url("http://uploaded.to/js/script.js");
    $script = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), $referrer, $cookie, 0, 0, $_GET["proxy"], $pauth);
    $editKey = generate(6);
    $serverUrl = cut_str($script, 'uploadServer = \'', '\'') . 'upload?admincode=' . $editKey . '&id=' . $uid . '&pw=' . $upas;
    $Url = parse_url("http://uploaded.to/io/upload/precheck");
    $id = rand(1, 15);
    $fileInfo['size'] = filesize($lfile);
    $fileInfo['id'] = 'file' . $id;
    $fileInfo['name'] = $lname;
    $fileInfo['editKey'] = $editKey;
    geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), 'http://uploaded.to/upload', $cookie, $fileInfo, 0, $_GET["proxy"], $pauth);
    ?>
        <script>document.getElementById('info').style.display='none';</script>
<?php 
    $url = parse_url($serverUrl);
    $upagent = "Shockwave Flash";
    $fpost['Filename'] = $lname;
    $fpost['Upload'] = 'Submit Query';
开发者ID:mewtutorial,项目名称:RapidTube,代码行数:31,代码来源:uploaded.to.php


示例11: schoolQuery

        }
        return $rarr;
    } else {
        $carr = schoolQuery("all", $sid);
        $r1 = 227;
        $r2 = 82;
        $g1 = 85;
        $g2 = 4;
        $b1 = 66;
        $b2 = 53;
        $grad = 1 / sizeof($carr);
        $i = 0;
        foreach ($carr as $key => &$elem) {
            $elem["color"] = sprintf("%02s", dechex($r1 + $i * $grad * ($r2 - $r1))) . sprintf("%02s", dechex($g1 + $i * $grad * ($g2 - $g1))) . sprintf("%02s", dechex($b1 + $i * $grad * ($b2 - $b1)));
            $i++;
        }
        return array("All clubs" => $carr);
    }
}
// MAIN
$master_arr = [];
if (isset($_GET["int"]) && isset($_GET["sid"])) {
    $int = $_GET["int"];
    $sid = $_GET["sid"];
    $arr_clubs = populate($int, $sid, $conn);
    if (isset($arr_clubs) && $arr_clubs != -1) {
        $arr_interests = flipsort($arr_clubs, $conn);
        $master_arr = generate($arr_interests, $sid, $conn);
    }
}
echo json_encode($master_arr, JSON_UNESCAPED_UNICODE);
开发者ID:ninjiangstar,项目名称:Uniclubs-php,代码行数:31,代码来源:generate.php


示例12: generate

 function generate($nav, $parent = 0, $level = 0)
 {
     $out = '<ul level="' . $level . '">';
     foreach ($nav[$parent] as $nav_item) {
         $out .= '<li href="' . $nav_item->href . '">';
         if (isset($nav[$nav_item->id])) {
             $out .= '<span class="arrow"><img src="images/arrow_r.png" alt=">" /></span>';
         }
         $out .= '<a href="' . $nav_item->href . '" ' . (isset($nav[$nav_item->id]) ? '' : 'class="dink"') . '>' . $nav_item->name . '</a>';
         if ($nav_item->add_href) {
             $out .= '<a href="' . $nav_item->add_href . '" class="add"> <span style="font-size:12px;color:#CEDDEC">+</span></a>';
         }
         if (isset($nav[$nav_item->id])) {
             $out .= generate($nav, $nav_item->id, $level + 1);
         }
         $out .= '</li>';
     }
     $out .= '</ul>';
     return $out;
 }
开发者ID:flyingfish2013,项目名称:Syssh,代码行数:20,代码来源:user_model.php


示例13: mysqli_fetch_row

         //Hash pass
         $login = $_POST['usernamesignup'];
         //Take login
         $db = Database::getInstance();
         $mysqli = $db->getConnection();
         $mysqli->query("SET NAMES utf8");
         //connect to DB
         $sql_query = 'SELECT * FROM user WHERE email="' . $email . '" OR user="' . $login . '"';
         //Chek user in DB with login and meil
         $result = $mysqli->query($sql_query);
         $row = mysqli_fetch_row($result);
         $name = $row[1];
         $mail = $row[3];
         //CHECK IF NO USERS WITH LOGIN AND PASS
         if (empty($name) and empty($mail)) {
             $verification = generate(10, 20);
             //Create verification code
             //INSERT USER IN DB
             $sql_query = "INSERT INTO user (user, password, email,status,verification,verification_code) VALUES ('{$login}', '{$hash}', '{$email}','1','0','{$verification}')";
             $result = $mysqli->query($sql_query);
             login($email, $hash);
             //IF LOGIN OR PASS BUSY
         } else {
             echo "LOGIN or PASSWORD is busy";
         }
         //IF NO CONFIRM
     } else {
         echo "Passwords are not equal";
     }
     //IF EMPTY
 } else {
开发者ID:Hydropericardium,项目名称:blog.dev,代码行数:31,代码来源:sign.php


示例14: str_replace

            $html = str_replace("{VIEW_WINE_TYPE}", "VOIR LES VINS TYPE", $html);
            $html = str_replace("{Follow_Us}", "Suivez Nous", $html);
            $html = str_replace("{FEATURED_COLLECTIONS}", "SELECTION DE COLLECTIONS", $html);
            $html = str_replace("{FEATURED_WINE}", "VIN EN VEDETTE", $html);
            $html = str_replace("{LAST_FROM_BLOG}", "DERNIER DE BLOG", $html);
            $html = str_replace("{LAST_FROM_NEWS}", "DERNIER DE NOUVELLES", $html);
            $html = str_replace("{CUSTOMER_SERVICE}", "SERVICE À LA CLIENTÈLE", $html);
            $html = str_replace("{contacts_linl}", "CONTACTEZ NOUS", $html);
            $html = str_replace("{We_promise}", "Nous nous engageons à vous envoyer que de bonnes choses", $html);
            break;
    }
}
function generate()
{
    $rand = mt_rand(00, 99999999);
    return $rand;
}
$html = str_replace("{generate}", generate(), $html);
$html = str_replace("{vendors_link}", vendors_link(), $html);
$html = str_replace("{types_link}", types_link(), $html);
$html = str_replace("{clear_cart}", "http://" . $_SERVER['HTTP_HOST'] . "/" . $_GET['lang'] . "/?clearcart=true", $html);
$html = str_replace("{host}", "http://" . $_SERVER['HTTP_HOST'], $html);
$html = str_replace("{lang}", $_GET['lang'], $html);
$html = str_replace("{popup_cart}", popup_cart(), $html);
$html = str_replace("{full_price}", $_SESSION['fullprice'], $html);
if ($_SESSION['fullprice']) {
    $html = str_replace("{popup_total}", "<span style='margin-left:16px;' class='pull-left'>total price</span> <element style='margin-right:16px;' class='pull-right'>" . $_SESSION['fullprice'] . " CHF</element><div class='clr'></div>", $html);
} else {
    $html = str_replace("{popup_total}", "totlal price <span class='badge ptotal'>0</span> CHF", $html);
}
echo $html;
开发者ID:siberex82,项目名称:nad,代码行数:31,代码来源:index.php


示例15: array

$vals = array($module_name, $module_human_name);
function generate($template, $dest, $keys, $vals)
{
    if (file_exists($dest)) {
        echo "{$dest} already exists.  Overwrite?  [Y/n]  ";
        $fp = fopen('php://stdin', 'r');
        $answer = trim(fgets($fp));
        fclose($fp);
        if (strcasecmp($answer, 'Y') && $answer) {
            return false;
        }
    }
    $tmpl = implode('', file($template));
    $tmpl = str_replace($keys, $vals, $tmpl);
    $fp = fopen($dest, "w") or exit(1);
    fputs($fp, $tmpl);
    fclose($fp);
    return true;
}
if (generate($genpath . '/templates/config.tpl.php', $module_dir . DS . 'config' . DS . 'config.php', $keys, $vals)) {
    echo "New Config:     {$module_dir}" . DS . 'config' . DS . "config.php\n";
}
if (generate($genpath . '/templates/urls.tpl.php', $module_dir . DS . 'config' . DS . 'urls.php', $keys, $vals)) {
    echo "New Config:     {$module_dir}" . DS . 'config' . DS . "urls.php\n";
}
if (generate($genpath . '/templates/page.tpl.php', $module_dir . DS . 'pages' . DS . 'page.php', $keys, $vals)) {
    echo "New Controller: {$module_dir}" . DS . 'pages' . DS . "page.php\n";
}
echo "\n";
echo "To enable this module, add it to the MODULES constant in config/config.php\n\n";
exit(0);
开发者ID:jvinet,项目名称:pronto,代码行数:31,代码来源:generate.php


示例16: generate

function generate($ds, $graph, &$data)
{
    if (!isset($ds['datasetURI']) || $ds['datasetURI'] == '') {
        echo "Dataset URI missing";
        if (isset($ds['title']) && $ds['title'] != '') {
            echo " - Dataset Title: " . $ds['title'];
        }
        return;
    }
    $rdf = $graph->resource($ds['datasetURI'], array('dataid:Dataset', 'odrl:license', 'dcat:Dataset', 'void:Dataset', 'sd:Dataset', 'prov:Entity'));
    if (isset($ds['title']) && $ds['title'] != '') {
        $rdf->set('dct:title', $ds['title']);
    }
    if (isset($ds['label']) && $ds['label'] != '') {
        $rdf->set('rdfs:label', $ds['label']);
    }
    if (isset($ds['description']) && $ds['description'] != '') {
        $rdf->set('dct:description', $ds['description']);
    }
    if (isset($ds['issued']) && $ds['issued'] != '') {
        $rdf->set('dct:issued', new EasyRdf_Literal_Date($ds['issued']));
    }
    if (isset($ds['rights']) && $ds['rights'] != '') {
        $rdf->set('dct:rights', $ds['rights']);
    }
    if (isset($ds['rootResource']) && $ds['rootResource'] != '') {
        $rdf->set('void:rootResource', $graph->resource($ds['rootResource']));
    }
    if (isset($ds['exampleResource']) && $ds['exampleResource'] != '') {
        $rdf->set('void:exampleResource', $graph->resource($ds['exampleResource']));
    }
    if (isset($ds['language']) && $ds['language'] != '') {
        $rdf->set('dct:language', $ds['language']);
    }
    if (isset($ds['ontologyLocation']) && $ds['ontologyLocation'] != '') {
        $rdf->set('void:vocabulary', $graph->resource($ds['ontologyLocation']));
    }
    if (isset($ds['landingPage']) && $ds['landingPage'] != '') {
        $rdf->set('dcat:landingPage', $graph->resource($ds['landingPage']));
    }
    if (isset($ds['keyword']) && $ds['keyword'] != '') {
        $rdf->set('dcat:keyword', $ds['keyword']);
    }
    if (isset($ds['license'])) {
        $rdf->set('dataid:licenseName', $ds['license']['name']);
        $rdf->set('dct:license', $graph->resource($ds['license']['val']));
    }
    if (isset($ds['datasets'])) {
        foreach ($ds['datasets'] as $ds2) {
            if (isset($ds2['datasetURI']) && $ds2['datasetURI'] != '') {
                $r = $graph->resource($ds2['datasetURI']);
                $graph->add($rdf, $ds2['type'], $r);
                generate($ds2, $graph, $data);
            } else {
                echo 'Error: Please check datasets URI!';
                return;
            }
        }
    }
    if (isset($ds["distribution"])) {
        foreach ($ds["distribution"] as $d) {
            if (isset($d['accessUrl']) && isset($d['prop'])) {
                $r = $graph->resource($d['accessUrl']);
                $graph->add($rdf, $d['prop'], $r);
            }
        }
    }
    if (isset($ds["linkset"])) {
        foreach ($ds["linkset"] as $l) {
            if (isset($l['exampleResource']) && isset($l['prop'])) {
                $r = $graph->resource($l['exampleResource']);
            }
            $graph->add($rdf, $l["prop"], $r);
        }
    }
    //contact information
    if (isset($ds["agent"])) {
        foreach ($ds["agent"] as $l) {
            $r;
            // if there is a resource
            if (isset($l['resource']) && $l['resource'] != '') {
                $r = $graph->resource($l['resource']);
                $graph->add($rdf, $l["prop"], $r);
                if (isset($l['label']) || isset($l['name']) || isset($l['mbox'])) {
                    //                  $r = $graph->resource($l['resource'], array('prov:Agent', 'foaf:Agent'));
                    $r = $graph->resource($l['resource'], array('dataid:Agent'));
                }
            } else {
                //              $r = $graph->newBNode(array( 'prov:Agent', 'foaf:Agent'));
                $r = $graph->newBNode(array('dataid:Agent'));
                $graph->add($rdf, $l["prop"], $r);
            }
            if (isset($l['label']) && $l['label'] != '') {
                $r->set('rdfs:label', $l['label']);
            }
            if (isset($l['name']) && $l['name'] != '') {
                $r->set('foaf:name', $l['name']);
            }
            if (isset($l['mbox']) && $l['mbox'] != '') {
                $r->set('foaf:mbox', $l['mbox']);
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:mexproject,代码行数:101,代码来源:genRdf2.php


示例17: call_color_scheme_api

    $result = call_color_scheme_api($api_type, $id);
    if (!$result) {
        die("null");
    }
    print json_encode($result);
});
$app->get("/api/package/?", function () use($app) {
    header("Content-type: text/json");
    if (!check_colors($app->request())) {
        die("null");
    }
    $api_type = $app->request()->params("api_type");
    $id = $app->request()->params("id");
    $c = $app->request()->params("c");
    $share = $app->request()->params("share");
    $result_generate = generate($api_type, $id, $c);
    if (!$result_generate) {
        die("null");
    }
    $theme_id = save_theme($api_type, $id, $c, $share);
    if (!$theme_id) {
        die("null");
    }
    if ($share) {
        $result = generate_for_gallery($theme_id);
        if (!$result) {
            die("null");
        }
    }
    print json_encode($result_generate);
});
开发者ID:jxav,项目名称:paintstrap,代码行数:31,代码来源:index.php


示例18: define

 * @version    1.0
 * @author     Fuel Development Team
 * @license    MIT License
 * @copyright  2010 - 2013 Fuel Development Team
 * @link       http://fuelphp.com
 */
/**
 * One file documenation system using Markdown files,
 * containing FFM (Fuel Flavoured Markdown)
 */
// FuelPHP version of these docs
define('VERSION', '2.0-dev');
// documentation page template to use
define('TEMPLATE', 'assets/html/v1template.html');
// whether or not we have to generate rewrite compatible URL's
define('REWRITE', isset($_GET['rewrite']) and $_GET['rewrite'] == 1);
// url to the API docs for this version
define('APIROOT', 'http://dev-api.fuelphp.com/classes/');
// relative path to the markdown doc files
define('DOCROOT', 'docs/');
// page to load when the site root is requested
define('INTROPAGE', '01-Introduction/01-Welcome.md');
// base url for this script
define('BASEURL', dirname($_SERVER['PHP_SELF']) . '/');
// load our markdown-2-html library
require __DIR__ . '/assets/lib/md2html.php';
// find the file to show
$page = whichpage(__DIR__) or $page = DOCROOT . '../NOTFOUND.md';
// and generate the HTML
echo generate($page);
开发者ID:jemmy655,项目名称:docs,代码行数:30,代码来源:index.php


示例19: mysql_connect

<?php

$con = mysql_connect("localhost", "Admin", "pkvcobas132");
if (!$con) {
    die("Reason : " . mysql_error());
}
mysql_select_db("spas", $con);
$totalSessionsStd = 0;
if (isset($_POST['submit'])) {
    $sql2 = "SELECT * FROM studentsess";
    $mydata = mysql_query($sql2, $con);
    $startDate = $_POST['start'];
    $stopDate = $_POST['stop'];
    while ($res2 = mysql_fetch_array($mydata)) {
        $totalSessionsStd = $res2['totalsess'];
        generate($res2['usn'], $startDate, $stopDate);
    }
}
include "prepareCSVFile.php";
/* Below Code generates random activities for a given USN, startDate and endDate */
/* *************************************************************************************************************************** */
/* *************************************************************************************************************************** */
function generate($stdUSN, $startDate, $endDate)
{
    global $con, $totalSessionsStd;
    /*echo 'stdUSN : '.$stdUSN.'<br />';
    		echo 'startDate : '.$startDate.'<br />';
    		echo 'endDate : '.$endDate.'<br />';
    		echo 'totalSessionsStd : '.$totalSessionsStd.'<br />';*/
    $totalSessionsStd++;
    $sql = "SELECT * FROM activity WHERE usn = '{$stdUSN}' and day >= '{$startDate}' and day <= '{$endDate}'";
开发者ID:varun1294,项目名称:SPAS,代码行数:31,代码来源:addNewAct.php


示例20: geturl

 echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
 $page = geturl('uploaded.net', 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
 is_page($page);
 $js = geturl('uploaded.net', 80, '/js/script.js', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
 is_page($js);
 if (!preg_match('@uploadServer = [\'|\\"](https?://([^\\|\'|\\"|\\r|\\n|\\s|\\t]+\\.)uploaded\\.net/)[\'|\\"]@i', $js, $up)) {
     html_error('Error: Cannot find upload server.', 0);
 }
 if (!preg_match('@id="user_id" value="(\\d+)"@i', $page, $uid)) {
     html_error('Error: UserID not found.');
 }
 if (!preg_match('@id="user_pw" value="(\\w+)"@i', $page, $spass)) {
     html_error('Error: Password hash not found.');
 }
 // $spass = array(1 => sha1($_REQUEST['up_pass']));
 $adm_link = generate();
 $post = array();
 $post['Filename'] = $lname;
 $post['Upload'] = 'Submit Query';
 $up_url = $up[1] . "upload?admincode={$adm_link}&id={$uid[1]}&pw={$spass[1]}";
 // Uploading
 echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
 $url = parse_url($up_url);
 $upfiles = upfile($url['host'], 80, $url['path'] . ($url['query'] ? '?' . $url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 'Shockwave Flash');
 // Upload Finished
 echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
 is_page($upfiles);
 $content = substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4);
 if (preg_match('@^(\\w+)\\,\\d@i', $content, $fid)) {
     $download_link = 'http://uploaded.net/file/' . $fid[1];
     // $download_link = 'http://ul.to/'.$fid[1];
开发者ID:mewtutorial,项目名称:RapidTube,代码行数:31,代码来源:uploaded.net_member.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP generateActivationToken函数代码示例发布时间:2022-05-15
下一篇:
PHP general函数代码示例发布时间: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