Ok- I have a script that generates a table from a database when called. I have put that script in a html box on the page. Below is the script:
I also have a header that is called using the include function. So I opened a html box and placed this inside:
But each time the link calls upon the page to create the table- the header is included in the table??????
Must the table be seperated and placed in a I-Frame?
Try it out- choose a link here
Andy
PHP Code:
<?php
//Declare and assign variable
$pg_genre = addslashes($_GET['pg_genre']);
//
//Now open file
if(!file_exists("listing_db.txt"))
{
echo"<table width=550 align=center>";
echo"<tr>";
echo"<td class='th tc ol fw fc'>NO RECORDS AT THIS TIME</td>";
echo"<tr>";
echo"<td class='th tc ol fw fc'>CHECK BACK LATER</td>";
echo"</tr>";
exit;
}
echo"<div style=\"border:3px #ccdd88 solid; width:580px; height:400px; overflow:auto;\">";
echo"<table border=6 align=center width=550 cellpadding=2 cellspacing=2>";
echo"<tr>";
echo"<th class='th tc ol fw fc'>Welcome to 123GPP Businesses and Services Directory</th>";
echo"</tr>";
//
$openedfile = fopen( "listing_db.txt", 'r' );
if($openedfile)
{
while (!feof( $openedfile ) )
{
$line = trim(fgets( $openedfile ));
if ( !empty( $line ) )
{
list( $genre,$entry1,$entry2, $entry3, $entry4, $entry5, $entry6,) = explode( "|", $line );
//////////////////////////////////
//Now check to see which ones match the link and then post them in the table
//
if($genre == $pg_genre)
{
echo"<tr class=>";
echo"<td class='td tc w2 fw ol ff'>$entry1</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2'>$entry2</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2 fw fc'>$entry3</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2'>$entry4</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2'>$entry5</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2'><a href='$entry6'>$entry6</td>";
echo"</tr>";
echo"</div>";
}
}
}
fclose( $openedfile );
}
else
{
echo"<tr>";
echo"<td class='th w2'>Cannot open file!</td>";
echo"</tr>";
echo"</table>";
}
?>
PHP Code:
<?php
include("gppheader.php");
?>
Must the table be seperated and placed in a I-Frame?
Try it out- choose a link here
Andy
Comment