特殊文字を HTML エンティティに変換してくれるhtmlspecialchars関数。 PHPでは基本中の基本である関数でありながら、名前の長さやオプションの設定などが面倒で困ったものです。「htmlspecialchars」は覚えられても、オプションの「ENT_QUOTES」まで覚えるのはなかなか大変だったりします。でも、ここで手を抜くと簡単に脆弱なアプリケーションができあがってしまう危険性があります。特にユーザーからの入力には、手軽にがっちり入力保険をかけておくべきです。 そんなわけで、htmlspecialcharsを簡単に扱えるようにする方法を考えてみました。 お知らせ:PHP5.4にて、htmlspecialchars()関数に互換性の問題が出てきましたので、当ページでも第三引数に文字コードを指定するコードに変更しました。以下、第三引数の"UTF-8"の部分は、利用中の文字コー
コンピュータ (108305) インターネット (65208) ウェブ制作 (42718) ゲーム (14416) 家電・AV機器 (15537) 趣味・スポーツ (33479) 書籍・音楽・映画 (20067) 旅行・地域情報 (27200) 学習・教育 (32314) 科学・統計資料 (19134) 生活 (71533) 医療・健康 (19649) 美容・ファッション (9872) グルメ・料理 (16725) ビジネス・経営 (39630) 政治・社会 (20489) 経済・金融・保険 (14802) 就職・転職 (7613) 芸能・タレント (10753) 芸術・文化・歴史 (24286) 人生相談 (14832) ネタ・ジョーク (10756) はてなの使い方 (10889) コレナニ? (4512) 質問する アンケートする 質問一覧 注目の質問 回答者ランキング 人力検索はて
Create an RSS feeds generator in PHP - Programmer Assist 次のコードスニペットをコピペすれば、PHPでライブラリを使わずRSS2.0を素早く組み立てられます。 自作ツールにRSS2.0を軽く組み込んでみたい、っていう場合に一瞬で実装可能です。 <?php header("Content-type: text/xml;charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo ' <rss version="2.0"> <channel> <title>Title</title> <link>http://website.com</link> <description>Description</description> <category>rss, feeds
Bambalam PHP EXE Compiler/Embedder 1.0 - Free php to exe converter! Bambalam PHP EXE Compiler/Embedder is a free command line tool to convert PHP applications to standalone Windows .exe applications. PHPコードをEXEに変換してスタンドアロンアプリにするツール、Bambalam PHP Exe Compilerの紹介。 PHP4.4.2で動くPHPコードならEXEに変換できます(PHP5は将来対応予定)。 作成されたEXEはDLLが不要で、スタンドアロンアプリとして動作します。 コンパイルされるものは、Truck MMCacheを使ってソースコードをEncode & Optimizeしてるみ
平素より「PHPプロ!」をご愛顧いただき、誠にありがとうございます。 2006年より運営してまいりました「PHPプロ!」ですが、サービスの利用状況を鑑みまして、2018年9月25日(火曜日)をもちましてサービスを終了させていただくことになりました。 サービス終了に伴いまして、2018年8月28日(火曜日)を持ちまして、新規会員登録ならびにQ&A掲示板への新たな質問、回答の投稿を停止させていただきます。 なお、ご登録いただいた皆様の個人情報につきましては、サービス終了後、弊社が責任をもって消去いたします。 これまで多くの皆様にご利用をいただきまして、誠にありがとうございました。 サービス終了に伴い、皆様にはご不便をおかけいたしますこと、心よりお詫び申し上げます。 本件に関するお問い合わせはこちらよりお願いいたします。
このページについての説明・注意など PHP は、Apache モジュールや、CGI、コマンドラインとして使用できるスクリプト言語です。このページでは、主に PHP における、Web アプリケーションのセキュリティ問題についてまとめています。 Web アプリケーションのセキュリティ問題としては、以下の問題についてよく取り挙げられていると思いますが、これらのセキュリティ問題について調べたことや、これら以外でも、PHP に関連しているセキュリティ問題について知っていることについてメモしておきます。 クロスサイトスクリプティング SQL インジェクション パス・トラバーサル(ディレクトリ・トラバーサル) セッションハイジャック コマンドインジェクション また、PHP マニュアル : セキュリティや、PHP Security Guide (PHP Security Consortium) には、PH
いまや、デザイナーですら、phpを使う時代になった。猫も杓子もphpである。以前は、「htmlが書けなきゃwebデザイナーじゃないよね」と言われていたのが、次第に「cssも書けなきゃ」「JavaScriptぐらい読めなきゃ」「phpを使えなきゃ」と、敷居があがってきた。webデザイナーの人たちも大変である。 phpは、確かに手軽に使える言語であり、いままでプログラミングに携わったことのない人であっても少し勉強すれば簡単なプログラムが書けてしまう。まして、C++やJavaで鍛えあげられたプログラマなら見た瞬間使えると言っても過言ではない。 しかし、セキュリティを確保することはそう簡単な問題ではない。このたび、ソシム株式会社から発売になった「PHP サイバーテロの技法 攻撃と防御の実際」(asin:4883374718)だが、この本は素晴らしい。現状知られているメジャーな攻撃方法14種類につい
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く