Jump to content

Help with basic php !! With template.php


enanospr

Recommended Posts

SORRY...

 

Here ya go... template.php code

 

----------------------

---------------------

<style type="text/css">

<!--

body {

margin-left: 0px;

margin-top: 0px;

margin-right: 0px;

margin-bottom: 0px;

background-image:url(images/bg.jpg);

}

-->

</style>

<link href="style.css" rel="stylesheet" type="text/css">

<style type="text/css">

<!--

.style9 {color: #CCCCCC}

-->

</style>

<table width="599" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td><table width="800" height="588" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">

      <tr>

        <td height="258" colspan="2" valign="top" bgcolor="#000000"><?php include("top.php")?></td>

      </tr>

      <tr>

        <td width="201" height="330" rowspan="2" valign="top" bgcolor="#2B2B2B"><?php include("menu.php")?></td>

        <td width="599" height="155" valign="top" bgcolor="#000000"><?php include("bannerad.php")?></td>

      </tr>

      <tr>

        <td valign="top" bgcolor="#000000"><p>

            <?php include($content); ?>

          </p>

            <p> </p>

          <p> </p></td>

      </tr>

    </table></td>

  </tr>

  <tr>

    <td><?php include("footer.php")?></td>

  </tr>

</table>

--------------------

--------------------

 

anything else..??

The problem is you are including a variable but there's no place on that page where the variable value/content is set. I'm not sure why you don't just include the file like you did the footer.php:

 

<?php include("nameofthetemplate.php") ?>

The problem is you are including a variable but there's no place on that page where the variable value/content is set. I'm not sure why you don't just include the file like you did the footer.php:

 

<?php include("nameofthetemplate.php") ?>

The problem is you are including a variable but there's no place on that page where the variable value/content is set. I'm not sure why you don't just include the file like you did the footer.php:

 

<?php include("nameofthetemplate.php") ?>

umm i think he wants to include different files depending on the get variables in the url

try this

<style type="text/css">
<!--
body {
   margin-left: 0px;
   margin-top: 0px;
   margin-right: 0px;
   margin-bottom: 0px;
   background-image:url(images/bg.jpg);
}
-->
</style>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style9 {color: #CCCCCC}
-->
</style>
<table width="599" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="800" height="588" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
      <tr>
        <td height="258" colspan="2" valign="top" bgcolor="#000000"><?php include("top.php")?></td>
      </tr>
      <tr>
        <td width="201" height="330" rowspan="2" valign="top" bgcolor="#2B2B2B"><?php include("menu.php")?></td>
        <td width="599" height="155" valign="top" bgcolor="#000000"><?php include("bannerad.php")?></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><p>
<?php
$file = $_GET['content'];
if($file == "")
{
$file = "main";
}
$content = "$file.php"
if (file_exists($content)) {
include($content); 
}
else
{
echo"The file your looking for doesn't exist.";
}
?>
          </p>
            <p> </p>
          <p> </p></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><?php include("footer.php")?></td>
  </tr>
</table>

 

soo what this will do is

when you go to the url content.php?content=whatever

it will include

"whatever.php"

where it says include("$content");

if they enter something that doesnt exist like

content.php?content=afsd8y87f78yccv

it will give the error

"The page you are looking for doesn't exist."

I don't see any $_GET call setting anything.

yea but the only reason i think he has include("$content"); is because he wants to use the url and include something accordingly

<?php
$file = $_GET['content'];
if($file == "")
{
$file = "main";
}
$content = "$file.php"
if (file_exists($content)) {
include($content); 
}
else
{
echo"The file your looking for doesn't exist.";
}
?>

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.