Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MySQL にテーブルがあります。ディレクトリに新しいファイルを作成したいのですが、各行には一意のページがあります。唯一の問題は、多くの行が同じユーザー (同じ ID) に関連していることです。ユーザーに自分のページだけが表示されるようにしたい。どうすればそれを行うことができますか?
www.site.com/128.htmlのような .htaccess ファイルと仮想アドレスを使用できます。 アップ アドレスの htaccess コードは次のとおりです。
RewriteRule (.*)\.html$ index.php?user_id=$1 [L]
ユーザー ID は $_GET['user_id'] 変数で確認できます。