0
我现在正在进行SEO优化,我想知道<title>
和<meta>
之类的东西是可以放在代码的中间还是放在底部?做<head>元素需要在代码的最顶端来服务SEO目的吗?
搜索引擎是否仍然会被搜索引擎所识别?我需要让他们暴露我的php代码,以便他们显示由该php代码定义的变量。
此外,他们必须在<head>
?
<?php
error_reporting(0);
include ('./includes/header.php'); ?>
<?php
$error = "";
$date_q = date('Y-m-d H:i:s');
$subject = mysql_real_escape_string(htmlentities($_GET['xyz']));
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<title><?php echo $subject ?></title>
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html" charset="UTF-8">
<meta name="robots" content="index, follow"/>
<meta name="author" content="<?php echo $subject ?>">
<meta name="keywords" content="<?php echo $subject ?>">
<meta name="description" content="<?php echo $subject ?>">
</head>
<body>
不,他们不能在中间或底部..如果您将这些标签放置在代码的底部或中间,这是非法标记。是的,你需要把这些标签放在你的'
'中。请查看本课程:http://www.w3schools.com/html/html_intro.asp – Jer@ C0dekid好的,但是如何将php变量转换成''标签呢,那么它的变量定义在''标签的下方? – Menel
你有什么想要存档的例子吗?如果是这样,请将其添加到您的问题。它使我们更容易给你答案。如果你想在元标签中使用PHP,你需要在''标签上面有这些变量。 –
Jer