right think im getting somewhere...
Have a look at http://www.rhinoracks.co.uk/data.php this is ok and I can customise the look and fit it into my pages fine...
Can someone help with adjusting the code to my fields though... Im getting nowhere with it!
I need 1 less colum so that it would be
"product code" "description" "price(ex vat)" "price inc vat"
When I try and edit fields it throughs it all out!!
code here
Code:
<html><body>
<table border='1' cellspacing='0' cellpadding='5'
width="440" style="border-collapse:collapse;
font-family:sans-serif;">
<tr style="background-color:gainsboro"><th colspan="2">
Employee</th><th>Sex</th>
<th>Hired</th><th>Salary</th></tr>
<colgroup>
<col span="2" align="left" />
<col span="1" align="center" />
<col span="2" align="right" />
<?PHP
$oddColor='whitesmoke';
$evenColor='azure';
$ID=0; $FirstName=1; $LastName=2; $HireDate=3;
$ReviewDate=4; $Salary=5; $Sex=6; $IsSelected=6;
$TheFile = fopen ("info.txt", "r");
if($TheFile){
$row = 0;
$Employee = strval(fgets($TheFile, 4096));
while (!feof ($TheFile)) {
$rec = explode("~",$Employee);
if($row % 2 == 0) {
$rowStart = "<tr style='background-color:".$evenColor."'><td>"; }
else {
$rowStart = "<tr style='background-color:".$oddColor."'><td>"; }
print $rowStart;
print $rec[$FirstName]. "</td><td>" ;
print $rec[$LastName]. "</td><td>" ;
print $rec[$Sex]. "</td><td>" ;
print $rec[$HireDate]. "</td><td>" ;
print "$".$rec[$Salary]. "</td></tr>";
$row++;
$Employee = strval(fgets($TheFile, 4096));
}
fclose ($TheFile);
}
?>
</table></body></html>
__________________
"I always wanted the adoration of John Lennon - With The Anonimity of Ringo Starr..."
QuizBay Help with the testing of this Beta site!
|