Jump to content

Can include filenames be called as variables?


rwcurry

Recommended Posts

I am creating a site where i have a php template for the page layout and would like to call different "content" include files from a menu.  The template looks similar to this.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>Test</title>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

<link rel="stylesheet" href="styles.css">

</head>

 

<body bgcolor="white">

<div id="container">

<div id="header">

<?php include 'includes/header.inc.php' ?>

</div>

 

<div id="includes/content.inc.php">

</div>

 

<?php include 'includes/footer.inc.php' ?>

</div>

</body>

</html>

 

 

I would like to have the "content" include file name changed by the value of a variable.  Is this possible. 

 

Sorry if this is obvious, I'm a newby and have been unable to find an answer so far.

 

thanks,  rwcurry

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.