displaying a nice neat table with date from a flatfile...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
romeo
Forum Contributor
Posts: 138
Joined: Sun Apr 21, 2002 12:50 pm

displaying a nice neat table with date from a flatfile...

Post by romeo »

here's what I have

Code: Select all

<?
$filename = "wpba.txt";
$file=file($filename);
while(list(,$value)=each($file))
&#123;
list($First_Name,$Last_Name,$Company,$Address,$City,$State,$Zip_Code,$Active,$Work_Phone,$Home_Phone,$Fax_Phone,$Email,,,,,,,,,,,,,,,,,$type)=split( ",", $value);

$First_Name = ucwords(strtolower($First_Name));
$Last_Name = ucwords(strtolower($Last_Name));
$Company = ucwords(strtolower($Company));
$Address = ucwords(strtolower($Address));
$City = ucwords(strtolower($City));
$State = ucwords(strtolower($State));
$Zip_Code = ucwords(strtolower($Zip_Code));
$Active = ucwords(strtolower($Active));
$Work_Phone = ucwords(strtolower($Work_Phone));
$Home_Phone = ucwords(strtolower($Home_Phone));
$Fax_Phone = ucwords(strtolower($Fax_Phone));
$Email = trim(strtolower($Email));

$type = strtoupper($type);

$turn = "left";

if($x==$type)&#123;

$msg .= '<table width="200" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="'."$turn".'"><tr><td>'.
     '<table width="200"><tr><td bgcolor="yellow" width="200"><b><font face="Arial" size="2">'."$Company".
     '</font></b></td></tr><tr><td><font face="Arial" size="2">'."$First_Name $Last_Name".
     '</font></td></tr><tr><td><font face="Arial" size="2">'."$Address".
     '</font></td></tr><tr><td><font face="Arial" size="2">'."$City, $State $Zip_Code".
     '</font></td></tr><tr><td><font face="Arial" size="2">'."Phone: $Work_Phone <br> Fax: $Fax_Phone <br>".
     '<a href="mailto:'."$Email".'">'."$Email".'</a>'.
     '</font></td></tr></table>'.'</td></tr></table>&nbsp;';

&#125;

&#125;
?>
Then I echo $msg into a table to display the data... the problem is that the list has gotten so ridiculously long (over 200 reocrds)...

I'm having trouble finding a way to display it.... inside of a 450pixel wide table... I was going to offset it (table align $turn (left then right), but it didn't turn out well for those lottle tables over 200px...


any ideas?

Thanks in advance...
Gremlin
Forum Newbie
Posts: 13
Joined: Thu May 02, 2002 7:03 pm
Location: California
Contact:

Post by Gremlin »

why not just display 30 records and have a link at bottom to display next 30 or previous 30?
romeo
Forum Contributor
Posts: 138
Joined: Sun Apr 21, 2002 12:50 pm

bump

Post by romeo »

:idea: bump - that's an idea but kinda customed to the way it is...
Post Reply