2010年04月17日 過去Blog
# stripcslashes() —- C言語と同様にバックスラッシュでクォートされた文字列を元に戻す # htmlentities() —- 適用可能な文字を全てHTML エンティティに変換する # nl2br() —- 改行文字の前にHTMLの改行タグを挿入する # strip_tags() —- 文字列からHTMLタグ、および PHPタグを取り除く
$text はフォームから受け取る文字列。 // HTML文字のエスケープ $text = htmlspecialchars( $_POST[“messege”] ); // magic_quotes_gpcの値がONなら削除 if ( get_magic_quotes_gpc() ) { $text = stripslashes( $text ); } // 改行処理 $text = nl2br($text); print_r($text); これでフォームから送信された文章内の改行をそのまま表示させることが出来る。

この投稿へのコメント

コメントはまだありません。

コメントを残す

メールアドレスが公開されることはありません。

次のHTML タグと属性が使えます。
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA


ピックアップ記事

zencart META内のauthor、generatorの設定

2010年06月29日 過去Blog
includes/templates/テンプレート名/common 内のhtml_header.phpを編集。 What is Darvocet?…
「zencart META内のauthor、generatorの設定」をはてなブックマークに追加

linux サーバのバックアップ箇所

2010年04月06日 過去Blog
■データベース関連 phpmyadmin データベース ■ユーザドキュメント関連 /home/ 内 ■ユーザ関連 /etc/passwd /etc/shadow /etc/group ■サーバ設定 /etc/ 内 バーチャルホストやvsftp,httpd関連の設定 メール関連の設定 buy valium roche…
「linux サーバのバックアップ箇所」をはてなブックマークに追加

PHP 配列の要素数を取得する

2010年06月11日 過去Blog
$array_count = count($array);
「PHP 配列の要素数を取得する」をはてなブックマークに追加

Drupal6でクリーンURL

2011年04月25日 過去Blog
.htaccessに以下を記述してルートに設置 # Various rewrite rules. <IfModule mod_rewrite.c>   RewriteEngine on   # Modify the RewriteBase if you are using Drupal in a subdirectory and   # the rewrite rules are n…
「Drupal6でクリーンURL」をはてなブックマークに追加

iOS SDK 4.2でdns.soが読み込めないエラー

2011年01月13日 過去Blog
実機でアプリをテストする際にデバッガ上に以下のようなエラーが頻発します。 原因を調べてみるとどうやら、無視して良いエラーのようですが、どうも気持ちが悪いですね。。 warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/li…
「iOS SDK 4.2でdns.soが読み込めないエラー」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy