변수에 따라 바뀌게 처리할려고 합니다. 다른 호스팅에서는 되는데
카페24 "10G 광아우토반 Full SSD" 에서는 않되네요...
어떻게 수정해야하나요?
Copy
<?switch($company){ case "1" : $title_01 = "회사소개"; $title_02 = "클린아이디어"; $page_file = "./page/company.php"; break; case "2" : $title = "title_1-1.jpg"; $title_01 = "회사소개"; $title_02 = "연혁"; $page_file = "./page/history.php"; break;}?><!doctype html><html><body><div class="wrap-cleanidea"> <div><?=$title_01?></div> <div><?=$title_02?></div> <div><? require_once "".$page_file.""; ?></div> </body></html>
답변 2개 / 댓글 4개
채택된 답변
+20 포인트
2016-12-13 (화) 17:24:42
$_GET['company']
다른 서버에서는 잘 되는 거라면,
<? 코드를 <?php로 변경해 보세요.
<?= 코드는 <?php echo 식으로 변경하시구..
답변에 대한 댓글 4개
2016-12-13 (화) 17:15:48
sinbi
2016-12-13 (화) 17:24:14
<div class="wrap-cleanidea">
<div><?php echo $title_01?></div>
<div><?php echo $title_02?></div>
<div><?php echo require_once "".$page_file.""; ?></div>
</div> <----추가
<div><?php echo $title_01?></div>
<div><?php echo $title_02?></div>
<div><?php echo require_once "".$page_file.""; ?></div>
</div> <----추가
2016-12-13 (화) 17:29:47
PHP Version은 5.5.17p1 이네요..
그리고 친절히 댓글써주신데로 바껏는데도 않되네요ㅠㅠ
<?php
switch($company)
{
case "1" :
$title_01 = "회사소개";
$title_02 = "클린아이디어";
$page_file = "./page/company.php";
break;
case "2" :
$title_01 = "회사소개";
$title_02 = "연혁";
$page_file = "./page/history.php";
break;
}
?>
<!doctype html>
<html>
<body>
<div class="wrap-cleanidea">
<div><?php echo $title_01?></div>
<div><?php echo $title_02?></div>
<div><?php echo require_once "".$page_file.""; ?></div>
</body>
</html>
그리고 친절히 댓글써주신데로 바껏는데도 않되네요ㅠㅠ
<?php
switch($company)
{
case "1" :
$title_01 = "회사소개";
$title_02 = "클린아이디어";
$page_file = "./page/company.php";
break;
case "2" :
$title_01 = "회사소개";
$title_02 = "연혁";
$page_file = "./page/history.php";
break;
}
?>
<!doctype html>
<html>
<body>
<div class="wrap-cleanidea">
<div><?php echo $title_01?></div>
<div><?php echo $title_02?></div>
<div><?php echo require_once "".$page_file.""; ?></div>
</body>
</html>
답변을 작성하려면 로그인이 필요합니다.
<?php
switch($company)
{
case "1" :
$title_01 = "회사소개";
$title_02 = "클린아이디어";
$page_file = "./page/company.php";
break;
case "2" :
$title = "title_1-1.jpg";
$title_01 = "회사소개";
$title_02 = "연혁";
$page_file = "./page/history.php";
break;
}
?>
<!doctype html>
<html>
<body>
<div class="wrap-cleanidea">
<div><?php echo $title_01?></div>
<div><?php echo $title_02?></div>
<div><?php echo require_once "".$page_file.""; ?></div>
</body>
</html>