layout getting screwed up

oiwio

New Member
Messages
214
Reaction score
0
Points
0
Im trying to add a PM section to my site and I got a couple of files from a friend that worked for him, but two of the 6 files he gave screw up the layout and I have no idea why. This has happened to me in the past but all I had to do was to put a blank form at the end and it would work but now it doesnt work. So heres one of the pages thats getting screwed up: http://alchemistrpg.com/pm.php

pm.php
PHP:
<? include("session.php");
readfile("top.txt");
    $player=$session->username;
    $userstats="SELECT * from users where username='$player'";
    $userstats2=mysql_query($userstats) or die("Could not get user stats");
    $userstats3=mysql_fetch_array($userstats2);
    print "<center>";
    print "<table class='maintable'>";
    print "<tr class='headline'><td><center>PMs</center></td></tr>";
    print "<tr class='mainrow'><td>";
    print "<center><A href='writepm.php'>Send PM</a>-<A href='deleteread.php'>Delete all read pms</a>-<A href='index.php'>Back to main game</a></center>";
    print "<center><table class='maintable'><tr class='headline'><td colspan='4'><center>Your PM box</center></td></tr>";
    print "<tr class='headline'><td></td><td>From</td><td>Subject</td><td>Delete</td></tr>";
    $getyourpms="SELECT * from fma_pms as a,users as b where a.receiver='$userstats3[ID]' and b.ID=a.sender order by a.therealtime DESC";
    $getyourpms2=mysql_query($getyourpms) or die("Could not get pms");
    while($getyourpms3=mysql_fetch_array($getyourpms2))
    {
      print "<tr class='mainrow'><td valign='top' width=6%>";
      if($getyourpms3[hasread]==0)
      {
        print "<img src='new.gif' border='0'>";
      }
      else
      {
        print "<img src='old.gif' border='0'>";
      }
      $pmsubject=strip_tags($getyourpms3[subject]);
      $pmsubject=htmlspecialchars($pmsubject);
      print "</td><td valign='top'>$getyourpms3[username]</td>";
      print "<td valign='top'>";
      print "<A href='readpm.php?ID=$getyourpms3[pmID]'>$pmsubject</a></td>";
      print "<td valign='top'><A href='delpm.php?ID=$getyourpms3[pmID]'>Delete PM</a></td></tr>";
    }
    print "<tr class='headline' height='7'><td colspan='4'></td></tr></table><br><br>";
    print "<form action='#' method='post'></td></tr></table></form>";
 readfile("bottom.txt");
?>

top.txt
Code:
<head>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
body {
 background-color: #000000;
}
.style2 {color: #FFFFFF; font-size: 9px; }
img {
border-width: 0px;
}
a.right_menu:link, a.right_menu:visited{
 color: #FFFFFF;
 font-size: 18px;
 text-decoration: none;
 }
a.right_menu:hover {
 color: #000000;
 font-size: 18px;
 text-decoration: none;
 background-color: #FFFFFF;
 border-color: #666666;
 border-width: 1px;
 border-style: solid;
 }
a.pm:link, a.pm:visited{
 text-decoration: none;
 }
body,td,th {
 color: #FFFFFF;
}
-->
</style>
<title>The Secrets of Alchemy</title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF">
<!-- ImageReady Slices (site layout.psd) -->
<table width="780" height="1001" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
 <tr>
  <td colspan="9">
   <img src="images/site-layout_01.jpg" width="780" height="49" alt=""></td>
 </tr>
 <tr>
  <td rowspan="4">
   <img src="images/site-layout_02.jpg" width="31" height="104" alt=""></td>
  <td colspan="4">
   <a href="index.php"><img src="images/logo.gif" width="331" height="30" alt="Logo"></a></td>
  <td colspan="4" rowspan="2">
   <img src="images/site-layout_04.jpg" width="418" height="54" alt=""></td>
 </tr>
 <tr>
  <td colspan="4">
   <img src="images/site-layout_05.jpg" width="331" height="24" alt=""></td>
 </tr>
 <tr>
  <td rowspan="2">
   <img src="images/site-layout_06.jpg" width="39" height="50" alt=""></td>
  <td><a href="index.php"><img src="images/home_tab.gif" width="105" height="35" border="0" alt="Home Tab"></a></td>
  <td>
   <a href="Town.php"><img src="images/town_tab.gif" width="105" height="35" border="0" alt="Town Tab"></a></td>
  <td colspan="2">
   <a href="account.php"><img src="images/account_tab.gif" width="105" height="35" border="0" alt="Account Tab"></a></td>
  <td>
   <a href="process.php"><img src="images/logout_tab.gif" width="105" height="35" border="0" alt="Logout Tab"></a></td>
  <td colspan="2" rowspan="2">
   <img src="images/site-layout_11.jpg" width="290" height="50" alt=""></td>
 </tr>
 <tr>
  <td colspan="5">
   <img src="images/site-layout_12.jpg" width="420" height="15" alt=""></td>
 </tr>
 <tr>
  <td valign="top" background="images/background.gif" colspan="8">

bottom.txt
Code:
</td>
  <td width="200" height="820" valign="top" background="images/right_menu.gif"><div align="center">
    <p>&nbsp;</p>
    <p><strong><a href="index.php" class="right_menu">HOME</a><br>
    </strong></p>
    <p><strong><a href="Town.php" class="right_menu">TOWN</a><br>
    </strong></p>
    <p><strong><a href="ranks.php" class="right_menu">RANKS</a><br>
    </strong></p>
    <p><strong><a href="pm.php" class="right_menu">PM</a><br>
    </strong></p>
<p><strong><a href="support.php" class="right_menu">HELP THE SITE</a><br>
</strong></p>
    <p><strong><a href="/smf/index.php" target="_blank" class="right_menu">FORUMS</a><br>
    </strong></p>
    <p><strong><a href="process.php" class="right_menu">LOGOUT</a></strong></p>
  </div></td>
 </tr>
 <tr valign="top">
  <td width="780" height="27" colspan="9" background="images/bottom_bar.gif"><div align="center">
    <P class=style2>Copyright &copy; by The Secrets of Alchemy 2007-2008<BR>
      Story made by Hiromu Arakawa </P>
  </div></td>
 </tr>
 <tr>
  <td>
   <img src="images/spacer.gif" width="31" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="39" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="105" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="105" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="82" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="23" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="105" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="90" height="1" alt=""></td>
  <td>
   <img src="images/spacer.gif" width="200" height="1" alt=""></td>
 </tr>
</table>
<!-- End ImageReady Slices -->
</body>
 

supajason

Member
Messages
288
Reaction score
2
Points
18
ok i think this should work!

Change
PHP:
readfile("top.txt");
To
PHP:
include("top.txt");
And Change
PHP:
readfile("bottom.txt");
To
PHP:
include("bottom.txt");

BINGO??
 

cowctcat

New Member
Messages
401
Reaction score
0
Points
0
Try instead of .txt files .html files as the apear to be html
 

oiwio

New Member
Messages
214
Reaction score
0
Points
0
Tried it with both bottom and top files, plus with both include and readfile and nothing worked
 
Top