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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:40:03+00:00 2026-05-22T20:40:03+00:00

I have 16 Documents with a php include in them to include a php

  • 0

I have 16 Documents with a php include in them to include a php template like this:

<?php include("templates/template.php"); ?>

Inside that template there is a little bit of PHP which finds the document name and prints it. The problem is that for the php document to be included its PHP is processed (Naturally because its PHP), this means that the document name finder is finding the name of the template and not the main document. What I am trying to do is have 16 PHP Files which act as a front end and are accessed by the User, these files include the Template file which finds the name of the accessed file and pulls html code from another file into the body of the template. This means that the content for the file is external to the Structure of the site and allows a level of simplicity for basic editing (I.E. The client can edit their website). As I stated above my method has a simple problem what I am trying to figure out is if anyway knows how to do this.The Template file is pasted below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script src="http://code.jquery.com/jquery-1.5.2.min.js" type="text/javascript">
</script>
<link href="css/styles.css" rel="stylesheet" type="text/css" /> 
<script type="text/JavaScript"> 
<!--
var screenwidth = screen.width;
if (screenwidth < 1180){
document.write('<link rel="stylesheet" href="css/ldrop.css" type="text/css" media="screen" />');
}
else
{
document.write('<link rel="stylesheet" href="css/drop.css" type="text/css" media="screen" />');
}
// -->
</script> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
<title>Alignment Courses</title> 
<link rel="shortcut icon" href="favicon.png" />
</head>
<body onload="makerequest('templates/quote.php','quote'); return false;makerequest('editing/<?php echo basename(__FILE__, '.' . pathinfo(__FILE__, PATHINFO_EXTENSION)); ?>.php','main')">
<div id="menu"><a href="index.html"><img src="webpics/logo.png" width="225" height="150" onmouseover="this.src='webpics/logoinv.png'" onmouseout="this.src='webpics/logo.png'" style="float:left" alt="Exit To Banner"/></a>
<div id="logo"><a href="index.html"><img src="webpics/Yoga Health.png" alt="Yoga Health Townsville" width="458" height="43" vspace="20"
onmouseover="this.src='webpics/Yoga Health Inv.png'"
onmouseout="this.src='webpics/Yoga Health.png'"/></a><a href="gallery.php" class="visit">visit the photo gallery</a></div> 
<div id="nav" class="mainmenu"> 
<ul>
<li class="menu1"><a href="home.php">Home</a></li>
<li class="menu2"><a href="#">Classes</a>
<ul>
<li><a href="daily.php">Daily</a></li>
<li><a href="beginner.php">Beginner</a></li>
<li><a href="alignment.php">Alignment</a></li>
<li><a href="prepare.php">Preparation</a></li>
</ul>
</li>
<li class="menu3"><a href="#">Family Yoga</a>
<ul>
<li><a href="family.php">Family Yoga</a></li>
<li><a href="kids.php">Childrens Yoga</a></li>
<li><a href="prenatal.php">Prenatal Yoga</a></li>
</ul>
</li>
<li class="menu4"><a href="#">Prices</a>
<ul>
<li><a href="prices.php">Classes</a></li>
<li><a href="purchase.php">Equipment</a></li>
</ul>
</li>
<li class="menu5"><a href="events.php">Events/Workshops</a>
<ul>
<li><a href="dance.php">Dance</a></li>
</ul>
</li>
<li class="menu6"><a href="teachers.php">Our Teachers</a></li>
<li class="menu7"><a href="contact.php">Location</a></li>
</ul>
</div></div>
<div id="content"><div id="sidebar"><div id="sidebar">
        <p><strong class="MyriadPromain"><em>Contacts</em></strong><br />
          <span class="MyriadProcontact">Shop 3, 262 Woolcock Street, Currajong, 4812 <br />
          <a href="mailto:info@yogahealth.net.au">Information: info@yogahealth.net.au</a><br />
          <a href="mailto:bookings@yogahealth.net.au">Bookings: bookings@yogahealth.net.au</a><br />
          Phone: 07 47 751 154<br />
          Mobile: 0410 085 054<br /><br /></span>
          <span class="ArialGroup">For Enquiries Regarding Group Bookings<br /><a href="documents/Group Bookings.pdf">Click Here</a></span>
        </p>
        <p><a href="http://www.facebook.com/pages/Yoga-Health-Townsville/140216156034239"><img src="http://www.yogahealth.net.au/webpics/facebook.gif" width="120" height="45" /></a></p>
        <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FYoga-Health-Townsville%2F140216156034239%23&amp;layout=box_count&amp;show_faces=false&amp;width=700&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=50" scrolling="No" frameborder="0" style="border:none; overflow:hidden; width:65px; height:65px;" allowtransparency="true"></iframe>
        <p>
          <a href="links.php" class="ArialGroup">Links to other Websites in our Community</a></p>
        <div class="quoteback">
        <a href="#" id="refresh"><img src="http://www.yogahealth.net.au/webpics/Refresh.gif" height="20px" width="20px" align="right" /></a>
         <div id="quote"><br \></div>
         </div>
         <br \>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 6000,
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#333333',
      color: '#ffffff'
    },
    tweets: {
      background: '#000000',
      color: '#ffffff',
      links: '#4aed05'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'all'
  }
}).render().setUser('YogaHealth1').start();
</script> 
         <?php include("templates/quotein.php"); ?>
      </div>
</div><div id="main"><?php include("editing/alignment.php"); ?></div></div>

<div id="footer"></div>
</body>
</html>

Many Thanks in advance.

  • 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-22T20:40:04+00:00Added an answer on May 22, 2026 at 8:40 pm

    Template should be a piece of code, which takes parameters and based on that generates output.

    The solution for this problem could be, that in that accessed file, you declare a variable with appropriate name and pass it to the template. There you will have each page differentiated as requested.

    Solution:

    Magic constant __FILE__ holds name of the included file, if used in include. So the solution is to move php code to the file, from which you are running the include.

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

Sidebar

Related Questions

I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have several A4 PDF documents which I would like (two into one) glue
I have a number of documents (mainly Word and Excel) that I'd like to
I have a Windows Forms (.NET) application that can have multiple documents open simultaneously.
I have 3 PDF documents that are generated on the fly by a legacy
I have a big load of documents, text-files, that I want to search for
I have a set of Word documents which I want to publish using a
I have a collection of HTML documents for which I need to parse the
I have been tearing my hair with this one for a while. index.php: $(document).ready(function(){
I have this query that searches my database for accommodation that has a type

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.