2010-05-27 6 views
1

작업 내 index.php에 문제가없는 받기, 나는 www.mysite.com/에 갈 때 내용이 작동포함 인덱스

 <?php $clase = $_GET['clase']; 
if ($clase == empresa) {include ("empresa.php");} 
elseif ($clase == productos) {include("productos.php");} 
else {include ($_SERVER['DOCUMENT_ROOT']."/inicio.html"); } 
?> 

을 제공하기 위해 어떤 결정이 작은 스크립트가 index.php

그러나 www.mysite.com에 갈 때 그것은 나던하지 않으며 우리의 이유를 파악할 수 없습니다.

답변

1

설정해야 productos.php 수 있습니다 서버는 기본 색인을 인식합니다.

Apache를 사용하고 httpd.conf 파일에서 DirectoryIndex을 변경하려고합니다. 나뿐만 아니라 것으로 기록하고 있었다

# 
# DirectoryIndex: sets the file that Apache will serve if a directory 
# is requested. 
# 
<IfModule dir_module> 
    DirectoryIndex index.php index.htm index.html 
</IfModule> 
+0

thx 도움을 위해, 마침내 httpd.conf에 문제가있었습니다. index.php가 미리 결정된 색인으로 사용되지 않았습니다. – diego

1

당신은 empresaproductos 따옴표 누락 :

<?php $clase = $_GET['clase']; 
if ($clase == 'empresa') {include ("empresa.php");} 
elseif ($clase == 'productos') {include("productos.php");} 
else {include ($_SERVER['DOCUMENT_ROOT']."/inicio.html"); } 
?> 
+0

:

여기 내 복사본입니다. – mingos

+0

땡! 땡땡! 나도. 재미 있은 – Gutzofter

1

가 (포함을 보장하기 위하여 서버의 경로를 포함 확인) empresa.php를 찾아

관련 문제