ファイルがたくさんありphp
ます。
それぞれにアクセスするphp
には、パラメータを使用しています。
例:index.php?route=changepassword
、、index.php?route=aboutus
など
パラメータをroute.php
正しいファイルにリンクする必要があります
使用する方が良い
If-Else statement
$route = $_GET['route'];
if ($route==changepassword) {
//statement
} else if ($route==aboutus) {
//statement
}
使用のswitch-case
?
$route = $_GET['route'];
switch ($route) {
case "changepassword" :
//statement
break;
case "aboutus" :
//statement
break;
}
これはたった2つのファイルです。10以上のファイルがあります。何を使用するのが良いですか?