Jump to content

Templates + arguments


Recommended Posts

HI there,

I have a dreamweaver php template with a table that consists of a banner at the top a horizontal menu bar an editable region bellow and a footer. This all works fine, but if i have a doc bassed on the template and if (and only if) i pass in an argument through the url (newsItem.php/?id=1) then the banner does not show... i have been staring at the code for ages and ant find why this is. im not sure why it would work fine if you dont pass an argument... has anyone seen anything like this before?

cheers for any help, muchly appreciated.

golyath

oh here is the code if you wanna see:

[tt]<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!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"><!-- InstanceBegin template="/Templates/PHP_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body text="#000000" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<div align="center"></div>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center"><img src="images/Banner.jpg" width="800" height="150" /></div></td>
  </tr>
  <tr>
    <td bgcolor="#095E00"><font color="#FFFFFF" size="-2" face="Verdana, Arial, Helvetica, sans-serif">|
      HOME | THE COMMITEE | SOCIAL EVENTS | SKI + BOARD TEAM | THE HOLIDAY | MERCHANDISE
      | MEDIA | LOG IN |</font></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="EditRegion3" -->
      <?
$username="astonsk";
$password="733edbb";
$database="astonsk_sur1";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");

$query="SELECT * FROM posts WHERE postID = $_GET[id]";
$result=mysql_query($query);

$title=mysql_result($result,$i,"title");
$date=mysql_result($result,$i,"date");
$content=mysql_result($result,$i,"content");
  ?>
  <table width="800" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><strong><font color="#000000" size="5" face="Verdana, Arial, Helvetica, sans-serif"><? echo $title ?></font></strong></td>
          <td><div align="right"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><? echo $date ?></font></div></td>
        </tr>
        <tr>
          <td colspan="2"><font color="#000000" size="-2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $content ?></font></td>
        </tr>
      </table>
<!-- InstanceEndEditable --></td>
  </tr>
  <tr>
    <td bgcolor="#095E00"><div align="center"><font color="#FFFFFF" size="-2" face="Verdana, Arial, Helvetica, sans-serif">&copy;
        Aston Snow 2006/2007</font></div></td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
[/tt]
Link to comment
https://forums.phpfreaks.com/topic/16182-templates-arguments/
Share on other sites

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.