나는 각 페이지에 동적으로 전용 메타 태그를 지정하려면 노력하고있어 기반으로 동적 메타 태그를 생성 헤더 - 가입 제목는 URL
키워드 - 가입 메타 키워드
설명 - 가입 설명
헤더
url.com/index.php?action=about - 약 제목
키워드 - 메타 키워드에 대한
설명 - 설명
에 대해 당신은 점을 얻었다.
배열을 사용하고 있지만 각 페이지를 각 배열에 할당하는 방법을 아직 알지 못했습니다.
CONF.PHP
<?php
$metas = array(
'index.php' => array(
'header' => 'Home Title',
'keywords' => 'Home Meta Keywords',
'description' => 'Home Meta Description'
),
'signup' => array(
'header' => 'Signup Title',
'keywords' => 'Signup Meta Keywords',
'description' => 'Signup Meta Description'
),
'about' => array(
'header' => 'About Title',
'keywords' => 'About Meta Keywords',
'description' => 'About Meta Description'
)
);
?>
index.php를
<TITLE><?php echo $metas['title']; ?></TITLE>
<meta name="description" content="<?php echo $metas['description']; ?>" >
<meta name="keywords" content="<?php echo $metas['keywords']; ?>" >
어떻게 각 페이지에 해당 값을 할당하는 ???
<TITLE><?php echo $metas['index.php']['title']; ?></TITLE>
스크립트의 이름은 당신이 $ _SERVER 슈퍼 전역 배열/변수에서 그것을 얻을 수 있습니다
그러나 모든 페이지가로드되면 index.php 배열에 index.php 배열을 넣을 수 있습니까? SIGNUP - index.php? action = signup/ABOUT - index.php? action = about ... etc – Darkeden
위의 편집을 참조하십시오. – Dharmavir
switch 메서드를 사용하여 값을 할당했습니다. 하지만 이제 MySQL 선택에서 변수를 할당하는 데 문제가 있습니다 ... 어떻게 할 수 있습니까? 예 : url.com/news/$id/$title - 그런 경우 메타 태그를 할당하는 방법은 무엇입니까? – Darkeden