2013-02-02 2 views
1

기본적으로 내 mysql의 모든 단일 항목에 대한 페이지를 만들려고하면 클릭 한 번 모든 항목이 데이터를 깊이 표시하는 페이지로 리디렉션됩니다. [0] 항목의 ID 번호 인

while ($row = $result->fetch_row()) { 

$article_page = "http://localhost/MCA/testpage.php/$row[0]"; 

echo '<tr><td><a href=' . "$article_page" .'>' . $row[1] . '</a></td><td>' . 
          $row[2] . '</td><td>' . 
          $row[3] . '</td><td>' . 
          $row[4] .'</td><td>' . 
    date("l jS \of F Y h:i:s A", strtotime($row[5])) .'</td></tr>'; 

    } 

답변

2

당신은을 적용하는 데 필요한 3 존재의 $ 행 www.example.com/examplepage.php/3 .... : 페이지의 예 .htaccess 파일을 통한 URI 리디렉션 규칙 또는 기타

변화의 예는 될 것이다 다음 : 당신은 청소를 위해 재 작성 URL을 사용해야합니다

$uri_segments = explode('/', $_SERVER['REQUEST_URI']); 
0

:

htaccess로 :

Options +FollowSymLinks 
IndexIgnore */* 

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . index.php 

PHP 이것을하는 방법. (httpd mod_rewrite 참조).