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 8467161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:33:47+00:00 2026-06-10T15:33:47+00:00

I need some help in generating dynamic web Title pages, based on what action

  • 0

I need some help in generating dynamic web Title pages, based on what action the user has taken. The code below is what I include at the top of all pages… $title changes according to the page I’m calling it from.

  <?php
      $title = "Biographies of Company Executives";
      require('includes/header.php');
  ?>

But, somewhere down the page, I’m running a DB query to get the actual position of the Company Executive that the user has clicked to view

Example of Query I’m running

 $bios = mysql_query( "SELECT *
                       FROM  `comp_bios`
                       WHERE `comp_bios_id` =  '{$id}'") or die(mysql_error());
                       $row = mysql_fetch_array($bios);

From the above query

                   $row[comp_bios_position]

is available to the page for usage.
How can I make $row[comp_bios_position] available to $title in the head section of my HTML

Thank you.

I saw this SO question, before asking mine. It didn’t answer the my question as I would have loved.

Similar Question

UPDATE: I added this to the header.php script, and still not working. No error is showing on the screen.

<title>
      <?php if(isset($row['comp_bios_position'])) {
               $title = $row['comp_bios_position'];} 
               echo $title; 
      ?>
</title>
  • 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-06-10T15:33:49+00:00Added an answer on June 10, 2026 at 3:33 pm

    My answer in the comment is still valid, put the select part above the require:

    <?php
          //Do all the selects:
          $bios = mysql_query( "SELECT *
                       FROM  `comp_bios`
                       WHERE `comp_bios_id` =  '{$id}'") or die(mysql_error());
                       $row = mysql_fetch_array($bios);
    
          //Use this how ever you want: $row[comp_bios_position]
          $title = "Biographies of Company Executives : " . $row[comp_bios_position];
          require('includes/header.php');
    ?>
    

    And you will have the $title in the header.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help with the CSS for generating a grid of perfect squares. Div's
I need some help in Apache poi I am generating excel using Apache POI
I need help re-factoring this legacy LINQ-SQL code which is generating around 100 update
I am generating some Dynamic SQL and would like to ensure that my code
I need some to help oon generating the XSL file for my XML Data.
I am very new to sql.I need some help in generating summery information MemberTable
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need some help with Activerecord Querying in a has_many :through association. Model: Job class
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview

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.