Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7613587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:11:28+00:00 2026-05-31T02:11:28+00:00

Hey I have a somewhat simple, i think, question… I am trying to pass

  • 0

Hey I have a somewhat simple, i think, question… I am trying to pass html text into a PHP variable so that I can use the value over and over again without having to change the META tags, title and description for every single page entity which would all be different. I want to keep it all condensed into one header.php page which is always called, but the Meta tags must change according to the pages title and description.

so for example,

page 1 title = Chicken

index.php:

<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/test/general.php');
include("header.php"); 
?>
<ul>
<li class="title"><?php $title = '?>Chicken<?php ';?> </li>
</ul>
</body>
</html>

general.php:

<?php
function siteinfo( $show='' ) {
echo get_siteinfo( $show, 'display' );
}


function get_siteinfo( $show = '', $filter = 'raw' ) {

switch( $show ) {
    case 'title':
        $output = $title;
        break;
return $output;
}
?>

header.php:

<html>
<head>
<meta name="title" content="<?php siteinfo( 'title' ); ?>" />
</head>
<body>

i know this part is really jacked up, not sure how it should work… essentially, i want the HTML to be the function value: <?php $title = '?>Chicken<?php ';?> but of course, the ‘ and second enclosing ‘ kill the whole function.

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:11:29+00:00Added an answer on May 31, 2026 at 2:11 am

    You’re overthinking the problem a bit. Something like this should work for your purposes:

    index.php:

    <?php
        $title = 'Chicken';
        include("header.php"); 
    ?>
    <ul>
        <li class="title"><?php echo $title; ?></li>
    </ul>
    </body>
    </html>
    

    header.php:

    <html>
    <head>
        <meta name="title" content="<?php echo $title; ?>" />
    </head>
    <body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I have a really simple question that needs more of just an explanation
Hey I have a really annoying IE7 bug that I am trying to work
Hey I have been trying to count the number of words in my text
Hey i have a situation in which i need to pass some variable value
Hey I have a problem in Javascript-PHP variable passing heres my php code: <li
Hey we have a library class (lib/Mixpanel) that calls delayed job as follows: class
Hey everyone, my problem is that im trying to figure out how to get
hey i have a counter text here and i need to know how to
Hey I have some problems creating my query into doctrine: My sql query looks
Hey I have got data in my variable using foreach($report as &rep) note it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.