请向我解释如何操作:
<?php
if(!isset($_GET['s'])) {
$_GET['s'] = ""; }
if ($_GET['s'] == "") { include("Templates/Tutorial/1.tpl"); }
if ($_GET['s'] == "1") { include("Templates/Tutorial/1.tpl"); }
if ($_GET['s'] == "2") { include("Templates/Tutorial/2.tpl"); }
if ($_GET['s'] == "3") { include("Templates/Tutorial/3.tpl"); }
if ($_GET['s'] == "4") { include("Templates/Tutorial/4.tpl"); }
if ($_GET['s'] == "5") { include("Templates/Tutorial/5.tpl"); }
?>
非常感谢!
答案 0 :(得分:1)
我认为这也有效
<?php
$inc = 1;
if(isset($_GET['s']) && $_GET['s'] != ""):
$inc = (int)$_GET['s'];
endif;
include("Templates/Tutorial/$inc.tpl");
?>