Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi how do i change <title></title> in my template to what page im on below is my template

HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title> title - mPanel</title>

And
if i click another page using same template the title must change.
Posted
v2

1 solution

Use any solution from here[^].

[Answer found by OP by researching the links I posted above]
page.php
PHP
ob_start();
include('Templates/Login/_header.php');
$buffer=ob_get_contents();
ob_end_clean();
$buffer=str_replace("%TITLE%","Login",$buffer);
echo $buffer;

header.php
PHP
<title>%TITLE%</title>
 
Share this answer
 
v2
Comments
Nico_Travassos 5-Mar-14 6:09am    
i have tryed most of those they don't work for some reason but i will do more research thanks
Yeah. I think you are missing something. :)
Else debug and find the problem.
Nico_Travassos 5-Mar-14 6:18am    
i found the problem thanks for your links :)
Nico_Travassos 5-Mar-14 6:19am    
page.php

ob_start();
include('Templates/Login/_header.php');
$buffer=ob_get_contents();
ob_end_clean();
$buffer=str_replace("%TITLE%","Login",$buffer);
echo $buffer;

header.php
<title>%TITLE%</title>
Great work. Most welcome. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900