私は、URLにディレクトリ構造があり、「どのように」と思っているサイトを見てきました。偽のディレクトリ構造を作成して使用するにはどうすればよいですか?
私は職場のウェブサイトを管理しており、コードを見てきました。彼らはすべてのページのデータベースを持っており、それらは動的に作成されます。
私のローカルサーバーでホームページを稼働させることはできますが、偽のディレクトリ構造をどこから始めるべきかを知る手がかりはありません。例はhttp://www.bankcharges.com/bank-charges-advice/
です。ディレクトリはありませんが、コンテンツはデータベースにあります。
どうしたのですか?私が関係していると思う
コードこれは、次のとおりです。
index.php
:
<?php
include('includes/functions.php');
$activeTab = "navhome";
$sent = false;
$title = (isset($_GET['title']))? mysql_real_escape_string($_GET['title']) : 'Home';
$title = str_replace('-',' ', $title);
if($title != '') {
$sql = "SELECT *
FROM contents
WHERE name LIKE '%$title%'
LIMIT 1";
$result = @mysql_query($sql);
$row = mysql_fetch_assoc($result);
}
//Set page title
$pagetitle = (isset($row['name']) && $title != 'Home')? ucwords($row['name']) : "Bank Charges";
?>
functions.php
:GoogleでURL書き換えのための
<?php
include('database.php');
include('settings.php');
//Nice URL's
function url($str){
$arr = array('!','"','£','$','%','^','&','*','(',')','_','+','{','}',':','@','~','<','>','?','|',',','.','\\','/',';',']','[','\'');
$str = str_replace($arr,"", str_replace(" ","-",strtolower($str)));
return $str;
}
function isEven($v){
if($v % 2 == 0) return true;
}
?>
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html – mpen