ナビゲーション
FrontPage
FreeBSD
Linux
Citrix XenServer
VMware ESXi
Unixコマンド
MySQL
PostgreSQL
Windows
CMS/CRM
クラウド
用語
PHPスクリプト
Bashシェルスクリプト
Rubyスクリプト
開発日記
検索
ツールボックス
新しいページの作成
バックアップの表示
外部のリンク元
最近更新したページ
全ページ
ヘルプ
凍結
アップロード
ページ名の変更
最新の40件
2016-08-17
Linux/NagiosQL
Linux/CentOSチューニング
2016-02-23
Linux/ソフトウェアRAID復旧手順
2016-02-18
FreeBSD/DHCP
FreeBSD/squid
2016-02-15
Unixコマンド/file
2016-02-05
FreeBSD/DynaBook
FreeBSD/Linux compatibility
2016-01-21
PHPスクリプト/PEAR DBインストールできない
PHPスクリプト/PEAR DB
2016-01-20
PHP/フレームワーク/Zend Framework
PHP/フレームワーク
FreeBSD/Postfix+amavisd+clamav
2016-01-15
FreeBSD/sl
2015-12-04
Unixコマンド/dig
Unixコマンド/nslookup
Unixコマンド/traceroute
Linux/rsync
FreeBSD/rsync
Unixコマンド/vipw
2015-11-25
Linux/Postfix+MySQL+Postfix AdminによるバーチャルSMTPサーバの構築
Linux/Postfix + postgrey
2015-11-24
Linux/Postfix + amavisd + clamav
2015-05-25
Unixコマンド/ifconfig
2015-05-23
Unixコマンド/netstat
Unixコマンド/route
Unixコマンド/lsof
Unixコマンド/disown
Unixコマンド/time
Unixコマンド/crontab
2015-05-22
Unixコマンド/nohup
Unixコマンド/fgとbg
Unixコマンド/nice
Unixコマンド/kill
Unixコマンド/jobs
Unixコマンド/restor
Unixコマンド/dump
Unixコマンド/uncompress
Unixコマンド/compress
Unixコマンド/zcat
total:
1692
today:
1
yesterday:
0
now:
1
本文
ノート
?
編集
差分
一覧
PHPスクリプト/CSV形式でダウンロード の編集
*CSV形式でダウンロード [#j377d361] **パート1 [#xbba35c1] <?php header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=output.csv"); @ini_set("include_path",ini_get("include_path")); require_once("DB.php"); $db = DB::connect('mysql://ユーザ名:パスワード@localhost/DB名'); if (PEAR::isError($db)) { die($db->getMessage()); } $sql = 'select * from logs;'; $res = $db->query($sql); while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)){ print $row[host].",".$row[program].",".$row[msg]."\n"; } $res->free(); exit; ?> **パート2 [#n0c43a9a] <?php $file_location = DATA_PATH . $filepath; $filesize = filesize($file_location); header ("Accept-Ranges: none"); header ("Content-Length: $filesize"); if(strstr($HTTP_USER_AGENT, "MSIE")){ header("Content-Type: $filemime"); }elseif($fileext == 'txt'){ header("Content-Type: application/octet-stream"); }else{ header("Content-Type: $filemime"); } header("Content-Disposition: attachment; filename=$filename1"); mb_http_output("pass"); $fp=fopen("$file_location","rb"); @fpassthru($fp); // fclose($fp); exit; ?> **エクスポート [#j5307ff2] mb_http_output('pass'); Header('Content-Disposition: attachment; filename="'."t_between_ken.csv" . '"'); Header('Content-Type: text/plain'); Header('Content-Type: text/plain');
タイムスタンプを変更しない
*CSV形式でダウンロード [#j377d361] **パート1 [#xbba35c1] <?php header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=output.csv"); @ini_set("include_path",ini_get("include_path")); require_once("DB.php"); $db = DB::connect('mysql://ユーザ名:パスワード@localhost/DB名'); if (PEAR::isError($db)) { die($db->getMessage()); } $sql = 'select * from logs;'; $res = $db->query($sql); while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)){ print $row[host].",".$row[program].",".$row[msg]."\n"; } $res->free(); exit; ?> **パート2 [#n0c43a9a] <?php $file_location = DATA_PATH . $filepath; $filesize = filesize($file_location); header ("Accept-Ranges: none"); header ("Content-Length: $filesize"); if(strstr($HTTP_USER_AGENT, "MSIE")){ header("Content-Type: $filemime"); }elseif($fileext == 'txt'){ header("Content-Type: application/octet-stream"); }else{ header("Content-Type: $filemime"); } header("Content-Disposition: attachment; filename=$filename1"); mb_http_output("pass"); $fp=fopen("$file_location","rb"); @fpassthru($fp); // fclose($fp); exit; ?> **エクスポート [#j5307ff2] mb_http_output('pass'); Header('Content-Disposition: attachment; filename="'."t_between_ken.csv" . '"'); Header('Content-Type: text/plain'); Header('Content-Type: text/plain');
テキスト整形のルールを表示する
ログインまたはアカウント作成