Hellow and good day,
i created a forum in php using one header and footer, now all my web pages have the same title as the home page. Please i need your help, i want to use the subject of a post as its header and the description as the meta description. I look forward to hearing from you. Thanks in advance

Recommended Answers

<?php
// you have your subject
$subject = ...;

do it in php:

// echo this in appropriate place in html (betwen <head> and </head> tags)
echo '<meta name="description" content="' . $subject . '">';
echo '<title>' . $subject . '</title>';
?>

or in html:

<meta name="description" content="<?php echo …
Jump to Post

All 2 Replies

<?php
// you have your subject
$subject = ...;

do it in php:

// echo this in appropriate place in html (betwen <head> and </head> tags)
echo '<meta name="description" content="' . $subject . '">';
echo '<title>' . $subject . '</title>';
?>

or in html:

<meta name="description" content="<?php echo $subject; ?>">
<title><?php echo $subject; ?></title>

thanks. let me check it out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.