96 8 PHPlot 1. ( 8.1) 4 1: // 2: // $_SERVER[ HTTP_REFERER ]... 3: // $_SERVER[ HTTP_USER_AGENT ]... 4: // $_SERVER[ REMOTE_ADDR ]... ( ) 5: // $_SERV

Similar documents
最新 Web 脆弱性トレンドレポート (08.0) ~08.0. Exploit-DB( より公開されている内容に基づいた脆弱性トレンド情報です ペンタセキュリティシステムズ株式会社 R&D センターデータセキュリティチーム サマリー 08 年

2

Flash Player ローカル設定マネージャー

ohp.mgp

ii II Web Web HTML CSS PHP MySQL Web Web CSS JavaScript Web SQL Web

untitled

最新 Web トレンドレポート (06.04) ~ Exploit-DB( より公開されている内容に基づいたトレンド情報です サマリー ペンタセキュリティシステムズ株式会社 R&D センターデータセキュリティチーム 06 年 4

untitled


untitled

untitled

IPA

Copyright 2006 Mitsui Bussan Secure Directions, Inc. All Rights Reserved. 3 Copyright 2006 Mitsui Bussan Secure Directions, Inc. All Rights Reserved.

農研機構 食品総合研究所 研究報告 77号

ORCA (Online Research Control system Architecture)

Hadoop Introduction

FileMaker Server Getting Started Guide

Microsoft Project Project 1984 No.1 Project PMBOK (Project Management Body of Knowledge) 1 2 ( ) 3 3 Project 3 Project Standard/Professional Office Pr

Cisco® ASA シリーズルーター向けDigiCert® 統合ガイド

54 5 PHP Web hellow.php 1:<?php 2: echo "Hellow, PHP!Y=n"; 3:?> echo PHP C 2: printf("hellow, PHP!Y=n"); PHP (php) $ php hellow.php Hellow, PHP! 5.1.2

Windows Oracle -Web - Copyright Oracle Corporation Japan, All rights reserved.

Web のクライアントサーバモデル

Microsoft PowerPoint ppt

ProVAL Recent Projects, ProVAL Online 3 Recent Projects ProVAL Online Show Online Content on the Start Page Page 13



5-5_arai_JPNICSecSemi_XssCsrf_CM_ PDF

~/WWW-local/compIID (WWW IID ) $ mkdir WWW-local $ cd WWW-local $ mkdir compiid 3. Emacs index.html n (a) $ cd ~/WWW/compIID

Oracle Web Conferencing Oracle Collaboration Suite 2 (9.0.4) Creation Date: May 14, 2003 Last Update: Jan 21, 2005 Version: 1.21

マイクロソフトのWebブラウザのいままでとこれから

1,.,,,., RDBM, SQL. OSS,, SQL,,.

Taro-WebGLサンプルの説明

トラブルシューティング-2.key


FileMaker Server 9 Getting Started Guide

FileMaker Server Getting Started Guide

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV


スマートアヴェニュー ご利用マニュアル

第2回_416.ppt

Homepage HTML+CSS Flash JavaScript Homepage Homepage Homepage Homepage Web HTML Hyper Text Markup Language XHTML XHTML HTML5 CSS Cascading Style Sheet

FileMaker Instant Web Publishing Guide

EDB-Report 最新 Web トレンドレポート (05.) 05..0~05.. Exploit-DB( より公開されている内容に基づいたトレンド情報です ペンタセキュリティシステムズ株式会社 R&D センターデータセキュリティチーム サマリー 05


johokiso-webpage-large

m_sotsuron

Oracle Application Server 10g( )インストール手順書

2009 Web B012-1

intra-mart ver /10/31 1. / intra-mart 3.2 AND intra-mart (JavaMail ) ( )

JavaScript の使い方

LAPLINK ヘルプデスク 導入ガイド

HIS-CCBASEver2

08encode part 2

Office Web ( IT Microsoft Office ID Office 24???? / ISO/IEC 27001???? 2

SSB_G_ver1.0_2013.8

<Documents Title Here>

n n n ( ) n Oracle 16 PostgreSQL 3 MySQL

07_経営論集2010 小松先生.indd

Microsoft PowerPoint - 情報システム pptx

Lync Server 2010 Lync Server Topology Builder BIG-IP LTM Topology Builder IP Lync 2010 BIG IP BIG-IP VE Virtual Edition BIG-IP SSL/TLS BIG-IP Edge Web

Oracle Application Server 10g(9


平和教育の目標と主題(案)

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè3²ó

¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥°¥é¥ß¥ó¥°ÆÃÏÀ

0序文‐1章.indd

PowerPoint Presentation

GPS携帯端末を用いた近隣バス停位置と

Transcription:

95 8 PHPlot PHP PHPlot 8.1 Web PHP Web $_SERVER[ key ] Apache P.119, P.120 4 key ( ) HTTP REFERER referer (varchar(512)) USER AGENT user agent (varchar(512)) REMOTE ADDR remote address (varchar(512)) REQUEST TIME request time (int) (unix10/access list.db) (access list.php)

96 8 PHPlot 1. ( 8.1) 4 1: // 2: // $_SERVER[ HTTP_REFERER ]... 3: // $_SERVER[ HTTP_USER_AGENT ]... 4: // $_SERVER[ REMOTE_ADDR ]... ( ) 5: // $_SERVER[ REQUEST_TIME ]... 6: 7: // $_SERVER ( ) 8: $referer = ; 9: $user_agent = ; 10: $remote_address = ; 11: $request_time = time(); // 12: if(isset($_server[ HTTP_REFERER ])) 13: $referer = $_SERVER[ HTTP_REFERER ]; 14: if(isset($_server[ HTTP_USER_AGENT ])) 15: $user_agent = $_SERVER[ HTTP_USER_AGENT ]; 16: if(isset($_server[ REMOTE_ADDRESS ])) 17: $remote_address = $_SERVER[ REMOTE_ADDRESS ]; 18: if(isset($_server[ HTTP_USER_AGENT ])) 19: $request_time = $_SERVER[ REQUEST_TIME ]; 20: 21: echo $_SERVER[. Y=. HTTP_REFERER. Y=. ] =>. $refer er. "<br />Y=n"; 22: echo $_SERVER[. Y=. HTTP_USER_AGENT. Y=. ] =>. $us er_agent. "<br />Y=n"; 23: echo $_SERVER[. Y=. REMOTE_ADDR. Y=. ] =>. $remote _address. "<br />Y=n"; 24: echo $_SERVER[. Y=. REQUEST_TIME. Y=. ] =>. $reque st_time. =>. date( Y-m-d H:i:s, $request_time). "<br />Y=n"; 8.1 2. SQLite unix10/access_list.db id (int ) 4

8.2 PHPlot 97 5 (access list all) access list.php 3. 4 access list.db access list.php ( 8.2) 8.2 8.2 PHPlot PHP PHPlot[7] PHPlot

98 8 PHPlot 8.2.1 PHPlot PHPlot GD (PHP ) PHPlot (phplot.php rgb.inc.php) ( ) True Type (ipaexg.ttf) PHPlot PHP GD(Graphics Draw) ( PNG ) Web GD phpinfo ( 8.3) 8.3 GD PHPlot Web [7] phplot.php(phplot ) rgb.inc.php( ) *1 PHP ( ) PHPlot ASCII TTF(True Type Font) *1 2011 2

8.2 PHPlot 99 IPA [8] ipaexg.ttf( ) phplot.php, rgb.inc.php 8.2.2 PHPlot ( PNG ) PHP PNG 8.4 8.4 PHP 1: require_once phplot.php ; // PHPlot 2: 3: // (2 ) 4: $data = array(); 5: 6: // $data = (, $x, func($x)) 7: for($i = 0; $i < 10; $i++) 8: { 9: $x[$i] = ($i + 1). " "; 10: $func_val[$i] = rand(); // 11: $data[$i] = array($x[$i], $func_val[$i]); 12: } 13: 14: // ( )

100 8 PHPlot 15: // 800 x 600 pixels 16: $graph = new PHPlot(800, 600); 17: // -> plain 18: $graph->setimagebordertype( plain ); 19: 20: // 21: $graph->setttfpath(./ ); // PHPlot 22: // IPA 8 18 23: $graph->setfontttf( title, ipaexg.ttf, 18); // 24: $graph->setfontttf( x_label, ipaexg.ttf, 8); // x 25: $graph->setfontttf( y_label, ipaexg.ttf, 8); // y 26: $graph->setfontttf( x_title, ipaexg.ttf, 10); // x 27: $graph->setfontttf( y_title, ipaexg.ttf, 10); // y 28: 29: // -> bars 30: $graph->setplottype( bars ); 31: // -> array(" ", ) 32: $graph->setdatatype( text-data ); 33: // -> $data 34: $graph->setdatavalues($data); 35: 36: // 37: $graph->settitle(" "); 38: 39: // : 40: $graph->setshading(0); 41: 42: // 43: $graph->drawgraph(); bar graph.php 8.4 PNG HTML IMG <img src="bar_graphp.php" /> 8.2.3 y = x 2 x, y 3 $data // $data = array(); // [$x_start, $x_end] x_div

8.2 PHPlot 101 $x_start = -5; $x_end = 5; $x_div = 100; $x_step = ($x_end - $x_start) / $x_div; // $data = (, $x, func($x)) for($i = 0; $i < $x_div; $i++) { $x[$i] = ($x_start) + ($x_step) * $i; $func_val[$i] = $x[$i] * $x[$i]; // xˆ2 $data[$i] = array(, $x[$i], $func_val[$i]); } // lines -> $graph->setplottype( lines ); // X, Y $graph->setxtitle("x"); $graph->setytitle("y"); // -> array(x, y ) $graph->setdatatype( data-data ); // -> $data $graph->setdatavalues($data); 8.5

102 8 PHPlot 8.2.4 PHPlot // $data = array(); // $data = (, $x, func($x)) for($i = 0; $i < 5; $i++) { $x[$i] = rand(); $data[$i] = array(($i + 1). " ", $x[$i]); } // pie -> $graph->setplottype( pie ); // text-data-single -> array(" ", ) $graph->setdatatype( text-data-single ); // -> $data $graph->setdatavalues($data); (legend) // & $graph->settitle(" "); $graph->setlegendstyle( left, left ); // (pixel ) // $graph->setmarginspixels(null, 50, 100, 50); // ( ) foreach($data as $row) { $graph->setlegend(implode(":", $row)); } // $graph->drawgraph(); 8.6

8.3 103 8.6 8.3 PHPlot user agent Internet Explorer, Firefox, AppleWebkit[10](Google Chrome Safari) Internet Explorer MSIE Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) Firefox Firefox Mozilla/5.0 (Windows; U; Windows NT 6.1; ja; rv:1.9.2.13) Gecko/20101 203 Firefox/3.6.13 AppleWebkit Webkit ( AppleWebkit ) Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.13 (KH TML, like Gecko) Chrome/9.0.597.98 Safari/534.13

104 8 PHPlot 16: // 17: $sql = "SELECT user_agent FROM ". $table; 18: $query_ret = $connect->query($sql); 19: 20: // $user_agent_name : 21: $user_agent_name = array( MSIE, Firefox, WebKit ); 22: 23: // 24: $data = array(); // 25: 26: for($i = 0; $i < count($user_agent_name); $i++) 27: $data[$i] = array($user_agent_name[$i], 0); 28: 29: while($str_user_agent = $query_ret->fetch()) 30: { 31: // 32: for($i = 0; $i < count($user_agent_name); $i++) 33: { 34: if(strpos($str_user_agent[0], $user_agent_name[$i])!= false) 35: $data[$i][1]++; 36: } 37: } access list graph browser.php access list graph 24hours.php 16: // 17: $sql = "SELECT request_time FROM ". $table; 18: $query_ret = $connect->query($sql); 19: 20: // $time_name : 0, 1,..., 23 21: $hour_name = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); 22: 23: // 24: $data = array(); // 25: 26: for($i = 0; $i < count($hour_name); $i++) 27: $data[$i] = array($hour_name[$i], 0); 28: 29: while($request_time = $query_ret->fetch()) 30: { 31: // 32: $hour = date( H, $request_time[0]);

8.3 105 33: 34: // 35: for($i = 0; $i < count($hour_name); $i++) 36: { 37: if($hour == $hour_name[$i]) 38: $data[$i][1]++; 39: } 40: } access list.php IMG 8.7 8.7

106 8 PHPlot B PHPlot ( Internet Explorer, Firefox, Webkit, ) 8 PHP PHPlot SQLite