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..??

Link to comment
Share on other sites

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."

Link to comment
Share on other sites

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.";
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.