PHPでクッキーを使おう

nesys No Comments »
add to hatena hatena.comment (1) add to del.icio.us (1) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 2

基本

PHPでクッキーを使うには単純にsetcookie関数を使えばよい。

PHP: setcookie - Manual
http://jp.php.net/manual/ja/function.setcookie.php

Read the rest of this entry »

PHPでバックグラウンド処理をしよう

nesys 1 Comment »
タグ:
add to hatena hatena.comment (3) add to del.icio.us (1) add to livedoor.clip (2) add to Yahoo!Bookmark (1) Total: 7

phpで外部プログラムを実行する方法はここ参照。

バックグラウンド処理とは、1つのプログラムの実行では作業時間のかかりすぎるもの、または重い処理を、別プロセスで外部プログラムを実行することだが、大規模なウェブサービスで膨大なデータベース処理をしたい場合などに頻繁に使われる。

Read the rest of this entry »

PHPで外部プログラムを実行しよう

nesys 1 Comment »
タグ:
add to hatena hatena.comment (4) add to del.icio.us (1) add to livedoor.clip (1) add to Yahoo!Bookmark (0) Total: 6

phpで外部プログラムを実行する関数は主に3つある。system関数、exec関数、passthru関数の3つ。
他にもproc_open関数などと便利なものもあるが、今回は置いておこう。

それぞれの違いは返り値にあるわけだが、実際にコードを実行して違いを見てみよう。

Read the rest of this entry »

CakePHPでデータを保存した直後に取得できない?

nesys No Comments »
タグ: ,
add to hatena hatena.comment (1) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 1

CakePHPでsaveした直後にfindしてデータを取得しようとも、キャッシュのせいで取りに行こうとしない場合がある。

Read the rest of this entry »

Smartyでforを回してページャーのようなものを作るには

nesys No Comments »
タグ: ,
add to hatena hatena.comment (1) add to del.icio.us (1) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 2

Smartyのsection関数のiterationを使うことでループの現在の値を得られるので、それを活用しよう。
実際に見た方が圧倒的に早いだろう。

Read the rest of this entry »

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in