<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>PHP日和り</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/" />
   <link rel="self" type="application/atom+xml" href="http://blog.creamu.com/phpbiyori/atom.xml" />
   <id>tag:blog.creamu.com,2009:/phpbiyori/2</id>
   <updated>2007-06-15T05:54:18Z</updated>
   <subtitle>今日もいい天気。PHP日和り。</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.21-ja</generator>


<entry>
   <title>新規ウィンドウのポップアップを画面中央にする方法</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/06/post_2.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.604</id>
   
   <published>2007-06-15T03:40:25Z</published>
   <updated>2007-06-15T05:54:18Z</updated>
   
   <summary><![CDATA[新規ウィンドウのポップアップを画面中央にする方法をメモ。 &lt;a href=...]]></summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="javascript" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="82" label="javascript" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="479" label="ポップアップ" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>新規ウィンドウのポップアップを画面中央にする方法をメモ。</p>

<p>&lt;a href=&quot;#&quot; onClick=&quot;window.open('http://www.goo.ne.jp/','_blank','width=300,height=300,left='+(window.screen.width-300)/2+',top='+(window.screen.height-300)/2);&quot;&gt;<br><br />
&lt;img src=&quot;http://***/img.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;</p>

<p>画面幅からウィンドウ幅(300)を引いたものを２で割ってleftに指定すると横中央、みたいな感じです。</p>

<p>■参考記事</p>

<p>&raquo; <a href="http://kikitai.teacup.com/kotaeru.php3?q=1943020">新規ウィンドウの表示位置を画面中央に</a></p>]]>
      
   </content>
</entry>

<entry>
   <title>smartyでfor文と同じループを実装</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/06/smartyfor.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.593</id>
   
   <published>2007-06-07T05:39:38Z</published>
   <updated>2007-06-07T05:45:13Z</updated>
   
   <summary>smartyでfor文と同じループを実装するときにいつも困るのでメモ。 $arr...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="smarty" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="617" label="for" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="104" label="smarty" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="618" label="ループ" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>smartyでfor文と同じループを実装するときにいつも困るのでメモ。</p>

<p>$arrayは配列<br />
nameは任意（sectionの中で使う）</p>

<p>{section loop=$arrayname=value start=0 step=1 max=$count_array}<br />
    {$array[$smarty.section.value.index][value]}<br />
{/section}</p>

<p>■参考記事</p>

<p>&raquo; <a href="http://kayano.jugem.cc/?eid=228">Smartyでfor文みたいな動きをさせるには</a></p>]]>
      
   </content>
</entry>

<entry>
   <title>PEARのHTML_QUICKFORMインストールメモ</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/06/pearhtml_quickform.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.592</id>
   
   <published>2007-06-06T19:11:09Z</published>
   <updated>2007-06-06T19:13:38Z</updated>
   
   <summary>PEARのHTML_QUICKFORMインストールメモ。 # pear list...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="608" label="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="615" label="PEAR" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="616" label="インストール" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>PEARのHTML_QUICKFORMインストールメモ。</p>

<p># pear list<br />
でインストール済みのものをチェック。</p>

<p>以下の順番でインストール。</p>

<p># pear install HTML_Common<br />
# pear install HTML_QuickForm</p>

<p>■参考記事</p>

<p>&raquo; <a href="http://shoulder.jp/archives/006611.php">PEAR::HTML_QuickForm の インストール</a></p>]]>
      
   </content>
</entry>

<entry>
   <title>HTML_QUICKFORMでクライアント側のjavascriptによるポップアップチェックを行うには</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/06/html_quickformjavascript.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.590</id>
   
   <published>2007-06-05T05:55:48Z</published>
   <updated>2007-06-07T05:46:06Z</updated>
   
   <summary>HTML_QUICKFORMでクライアント側のjavascriptによるポップア...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="608" label="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="82" label="javascript" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>HTML_QUICKFORMでクライアント側のjavascriptによるポップアップチェックを行うにはheadの中に{$form.javascript}と記述</p>]]>
      
   </content>
</entry>

<entry>
   <title>HTML_QUICKFORMでformにname、およびidを設定する</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/html_quickformformnameid.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.584</id>
   
   <published>2007-05-30T03:44:25Z</published>
   <updated>2007-05-30T03:45:01Z</updated>
   
   <summary>HTML_QUICKFORMについてメモ。 $form    = new HTM...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="609" label="form" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="608" label="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>HTML_QUICKFORMについてメモ。</p>

<p>$form    = new HTML_QuickForm(test);</p>

<p>上記から↓のタグが出力されます。</p>

<form name="test" id="test"..>]]>
      
   </content>
</entry>

<entry>
   <title>UTF-8での全角文字は3バイト</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/post_1.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.583</id>
   
   <published>2007-05-29T05:26:59Z</published>
   <updated>2007-05-30T03:44:10Z</updated>
   
   <summary>UTF-8での全角文字は3バイトで計算されるようです！ これにははまった！...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="入力チェック" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="604" label="UTF-8" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="606" label="バイト" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="605" label="全角" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>UTF-8での全角文字は3バイトで計算されるようです！</p>

<p>これにははまった！</p>]]>
      
   </content>
</entry>

<entry>
   <title>headers already sent byのエラーが起きたときの対処法</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/headers_already_sent_by.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.579</id>
   
   <published>2007-05-26T07:35:37Z</published>
   <updated>2007-05-26T07:38:21Z</updated>
   
   <summary>header(&quot;Location:の先に特定のrequire_onceがあると「...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="バグフィックス" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="589" label="エラー" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>header("Location:の先に特定のrequire_onceがあると「headers already sent by」のエラーが出ることがあるため、特定のrequire_onceをheader("Location:の後におくと直ることがあります。・・・1時間くらいはまりました。</p>]]>
      
   </content>
</entry>

<entry>
   <title>HTML_QUICKFORMのエラー出力</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/html_quickform.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.575</id>
   
   <published>2007-05-22T03:51:34Z</published>
   <updated>2007-05-22T03:53:27Z</updated>
   
   <summary>javascriptエラー：{$form.javascript} PHPエラー（...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="598" label="HTML_QUICKFORM&lt;PEAR エラー" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>javascriptエラー：{$form.javascript}</p>

<p>PHPエラー（urlは変数名）：<br />
{if $form.url.error}<br />
{$form.url.error}<br />
{/if}<br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Linuxコマンドメモ</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/linux.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.573</id>
   
   <published>2007-05-21T11:07:29Z</published>
   <updated>2007-05-21T07:10:24Z</updated>
   
   <summary>ｙｙｐで行コピー tail -fでプロセス監視...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="594" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="571" label="コマンド" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>ｙｙｐで行コピー</p>

<p>tail -fでプロセス監視</p>]]>
      
   </content>
</entry>

<entry>
   <title>MySQLの日付型、timestampとdatetime</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/mysqltimestampdatetime.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.566</id>
   
   <published>2007-05-18T02:35:14Z</published>
   <updated>2007-05-18T03:35:19Z</updated>
   
   <summary>MySQLのdate型で困ったのでメモ。 datetimeもtimestampも...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="MySQL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="587" label="MySQL" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>MySQLのdate型で困ったのでメモ。</p>

<p>datetimeもtimestampも、「YYYY-MM-DD HH:MM:SS」という形としては同じだけど、timestampはそのカラムを更新していなくても、別のカラムを更新するとtimestampカラムも更新されるので注意。</p>

<p>datetimeは更新されません。</p>]]>
      
   </content>
</entry>

<entry>
   <title>日本時間とアメリカのPDT（Pacific Daylight Time）との時差</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/05/pdtpacific_daylight_time.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.563</id>
   
   <published>2007-05-16T03:48:52Z</published>
   <updated>2007-05-16T03:51:34Z</updated>
   
   <summary>APIのダウンタイムがPDTで伝えられるのでメモ。 日本時間とアメリカのPDT（...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="API" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="583" label="PDT" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="581" label="日本時間" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>APIのダウンタイムがPDTで伝えられるのでメモ。</p>

<p>日本時間とアメリカのPDT（Pacific Daylight Time）との時差は「<strong>16時間</strong>」です！</p>]]>
      
   </content>
</entry>

<entry>
   <title>DNSキャッシュをクリアする方法</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/04/dns.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.514</id>
   
   <published>2007-04-17T15:25:01Z</published>
   <updated>2007-04-17T15:26:42Z</updated>
   
   <summary>ちょっとしたきっかけでローカルのDNSキャッシュをクリアする機会があったのでメモ...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="コマンドプロンプト" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>ちょっとしたきっかけでローカルのDNSキャッシュをクリアする機会があったのでメモエントリー。</p>

<p>コマンドプロンプトで以下のコマンドを実行。</p>

<p>■DNSキャッシュの確認<br />
　ipconfig/displaydns</p>

<p>■DNSキャッシュのクリア<br />
　ipconfig/flushdns</p>]]>
      
   </content>
</entry>

<entry>
   <title>smarty内にコメントを書く方法</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/03/smarty_1.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.482</id>
   
   <published>2007-03-26T13:19:18Z</published>
   <updated>2007-03-26T13:20:39Z</updated>
   
   <summary>smarty内にコメントを書く方法は以下。 {*コメント*}...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="smarty" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="104" label="smarty" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="481" label="コメント" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>smarty内にコメントを書く方法は以下。</p>

<p>{*コメント*}</p>]]>
      
   </content>
</entry>

<entry>
   <title>smartyでデバッグする方法</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/03/smarty.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.481</id>
   
   <published>2007-03-26T13:15:39Z</published>
   <updated>2007-03-26T13:18:31Z</updated>
   
   <summary>smartyのデバッグは以下をテンプレートファイルに記述。 {debug out...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="smarty" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="104" label="smarty" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="480" label="デバッグ" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>smartyのデバッグは以下をテンプレートファイルに記述。</p>

<p>{debug output="html"} </p>

<p>変数の中身をわかりやすく表示してくれていい感じです。</p>]]>
      
   </content>
</entry>

<entry>
   <title>HTML_QUICKFORMでclientのjavascriptチェックメッセージを変更する方法</title>
   <link rel="alternate" type="text/html" href="http://blog.creamu.com/phpbiyori/2007/03/html_quickformclientjavascript.html" />
   <id>tag:blog.creamu.com,2007:/phpbiyori//2.480</id>
   
   <published>2007-03-26T01:40:20Z</published>
   <updated>2007-03-26T01:45:42Z</updated>
   
   <summary>Invalid information enterd. Please corre...</summary>
   <author>
      <name>CREAMU</name>
      
   </author>
   
      <category term="HTML_QUICKFORM" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="478" label="HTML_QUICKFORM&lt;PEAR" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="82" label="javascript" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="479" label="ポップアップ" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="ja" xml:base="http://blog.creamu.com/phpbiyori/">
      <![CDATA[<p>Invalid information enterd.<br />
Please correct these fields.</p>

<p>上記のメッセージがclientのjavascriptチェックのポップアップで出てきてしまいます。</p>

<p>ユーザサービス的にはこれはかっこ悪い。</p>

<p>以下をHTML_QUICKFORMに追記すればメッセージは出なくなります。</p>

<p>$form->setJsWarnings("","");</p>

<p>ちなみに以下のように2種類テキストを設定することもできます。</p>

<p>$form->setJsWarnings("入力エラーです。","上記の項目を修正してください。");</p>

<p>出力ポップアップは↓</p>

<p>入力エラーです。<br />
例：名前が入力されていません。<br />
上記の項目を修正してください。</p>]]>
      
   </content>
</entry>

</feed>

