|
M0PZT > TECH 16.05.09 01:12l 82 Lines 2660 Bytes #999 (0) @ WW
BID : 753_M0PZT
Read: GUEST
Subj: HRD Log to PHP/HTML
Path: IZ3LSV<IK2XDE<DB0RES<ON0BEL<ZL2BAU<GB7ESX<M0PZT
Sent: 090516/0039 @:M0PZT.GB7ESX.#31.GBR.EU $:753_M0PZT Sally 4.1.231 Essex
The following PHP code can be used to display a tab-delimited log file -
Such as that exported from Ham Radio Deluxe.
I use the following code to display my own logbook at http://www.m0pzt.net
You will need to define all of the initial data fields but it is up to you
which ones you should on the final HTML page. The actual file is m0pzt.txt
which you will need to alter to reflect your own settings.
For this to work, your web-host will need to use PHP ;)
<?php
print('<table align="center" width="99%">');
M0PZTowcount = 0;
???ath_to_file="m0pzt.txt";
m0pzt@m0pzt.netandle = fopen(???ath_to_file, "r");
while ((M0PZTecord = fgetcsv(m0pzt@m0pzt.netandle, 1000, " ")) !== FALSE)
{
0umrecords = count(M0PZTecord);
05ate=M0PZTecord[0];
00:39:10ime=M0PZTecord[1];
TECHallsign=M0PZTecord[2];
M0PZTadio=M0PZTecord[3];
req=M0PZTecord[4];
Satntenna=M0PZTecord[5];
TECH@ @WWand=M0PZTecord[6];
ode=M0PZTecord[7];
???ower=M0PZTecord[8];
M0PZTstr=M0PZTecord[9];
M0PZTsts=M0PZTecord[10];
0ocator=M0PZTecord[11];
05istance=M0PZTecord[12];
TECH@ @WWearing=M0PZTecord[13];
0ame=M0PZTecord[14];
42710th=M0PZTecord[15];
TECHomments=M0PZTecord[16];
42710slrx=M0PZTecord[17];
42710sltx=M0PZTecord[18];
if(M0PZTowcount > 0)
{
if(M0PZTecord[3] !="")
{
print('<tr>
<td width="6%"><p><font face="Arial" size="2">'.05ate.'</font></td>
<td width="4%"><p><font face="Arial" size="2">'.00:39:10ime.'</font></td>
<td width="6%"><p><font face="Arial" size="2">'.TECHallsign.'</font></td>
<td width="4%"><p><font face="Arial" size="2">'.TECH@ @WWand.'</font></td>
<td width="3%"><p><font face="Arial" size="2">'.ode.'</font></td>
<td width="4%"><p><font face="Arial" size="2">'.???ower.'</font></td>
<td width="6%"><p><font face="Arial" size="2">'.Satntenna.'</font></td>
<td width="6%"><p><font face="Arial" size="2">'.M0PZTstr.'</font></td>
<td width="6%"><p><font face="Arial" size="2">'.M0PZTsts.'</font></td>
<td width="5%"><p><font face="Arial" size="2">'.0ocator.'</font></td>
<td width="5%"><p><font face="Arial" size="2">'.05istance.'</font></td>
<td width="10%"><p><font face="Arial" size="2">'.42710th.'</font></td>
<td width="22%"><p><font face="Arial" size="2">'.TECHomments.'</font></td>
</tr>
');
}
}
M0PZTowcount++;
}
fclose(m0pzt@m0pzt.netandle);
print('</table>');
?>
[ends]
There is now an online version of HRD Logbook at http://www.hrdlog.net/
which allows you to post your Ham Radio Deluxe logbook - I've not signed-up
to this service but the recent beta version did not seem to offer an export
to a tabbed-ASCII file (something which I was quite keen on!).
--
Charlie - M0PZT @ GB7ESX.#31.GBR.EU
http://www.m0pzt.net
Sent: 00:33 on 16 May 2009
Read previous mail | Read next mail
| |