Page< title>来自include变量? [英] Page <title> from include variable?

查看:55
本文介绍了Page< title>来自include变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有这样的话:


< title><?php print($ pagetitle); ?>< / title>

< body>

<?php include(" folders / my_include.php"); ?>

< / body>

< / html>


和my_include.php包含值变量($ pagetitle)。我如何在< title>的代码之前获得
的值是写的。这只是一个

基本的例子我曾经试过并提出我的问题,我的网站有一整套

包括从用户输入动态生成的包。我只想

得到< title>根据包含中的变量进行更改......但是

我卡住了吗?


我应该说我的所有包含都包含了自己,他们

包含一个html模板。所以放置<?php包括(" folders / my_include.php");

?>在标题标签看起来不太好之前:)


谢谢


mark

IF I have something like this:

<title><?php print($pagetitle); ?></title>
<body>
<?php include("folders/my_include.php"); ?>
</body>
</html>

and my_include.php contains the value to the variable ($pagetitle). How do I
get the value before the code for the <title> is written. This is just a
basic example I used to try and put across my question, my site has a whole
bunch of includes dynamically generated from user input. I''d just like to
get the <title> to change according to a variable in the includes......but
Im stuck?

I should say also that all my includes have includes themselves, they
include a html template. So placing <?php include("folders/my_include.php");
?> before the title tag won''t look very good :)

thanks

mark

推荐答案

pagetitle); ?>< / title>

< body>

<?php include(" folders / my_include.php"); ?>

< / body>

< / html>


和my_include.php包含值变量(
pagetitle); ?></title>
<body>
<?php include("folders/my_include.php"); ?>
</body>
</html>

and my_include.php contains the value to the variable (


pagetitle)。我如何在< title>的代码之前获得
的值是写的。这只是一个

基本的例子我曾经试过并提出我的问题,我的网站有一整套

包括从用户输入动态生成的包。我只想

得到< title>根据包含中的变量进行更改......但是

我卡住了吗?


我应该说我的所有包含都包含了自己,他们

包含一个html模板。所以放置<?php包括(" folders / my_include.php");

?>在标题标签看起来不是很好之前:)


谢谢


mark
pagetitle). How do I
get the value before the code for the <title> is written. This is just a
basic example I used to try and put across my question, my site has a whole
bunch of includes dynamically generated from user input. I''d just like to
get the <title> to change according to a variable in the includes......but
Im stuck?

I should say also that all my includes have includes themselves, they
include a html template. So placing <?php include("folders/my_include.php");
?> before the title tag won''t look very good :)

thanks

mark



" mark" < DG ******* @ asdfasd.com>在留言中写道

新闻:bs ********** @ news5.svr.pol.co.uk ...

如果我有类似的话这个:


< title><?php print(

"mark" <dg*******@asdfasd.com> wrote in message
news:bs**********@news5.svr.pol.co.uk...
IF I have something like this:

<title><?php print(


这篇关于Page&lt; title&gt;来自include变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆