mahenda Posted July 20, 2019 Share Posted July 20, 2019 /*i have some pages and i want to user to see an appropriate title when user click new page example: at home page on the tab the title must be written as welcome at hendra|home and when user clicked on about page, the tab must show another title like this you are at hendra|about page how to do this in php*/ //head <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title><?php echo $title; ?></title> </head><!--/end of head--> <body> //index page <?php include_once('head.php'); $title = 'welcome at hendra|home'; ?> //about page <?php include_once('head.php'); $title = 'you are at hendra|about page'; ?> Quote Link to comment Share on other sites More sharing options...
Barand Posted July 20, 2019 Share Posted July 20, 2019 Put your PHP code before the HTML code in your scripts. Then things like $title can be given a value before you output them Quote Link to comment Share on other sites More sharing options...
mahenda Posted July 20, 2019 Author Share Posted July 20, 2019 14 minutes ago, Barand said: Put your PHP code before the HTML code in your scripts. Then things like $title can be given a value before you output them thank you so much now it is working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.