I want to create a php file that reads HTML file that is uplaoded daily to a folder on my web server, when ever I open the page it needs to read the HTML file and post only data i want to use, i have created some reader but it always opens the file then it write the eact file as is in my PHP page. The HTML file has too much data in it, I want to use certain lines information only. The data in the HTML file is never the same, it is transactions (from top of page to bottom) at the bottom is summary of data, I want to use the heading lines (Title) of the HTML and the summary at the bottom
Becuase the transactions are never the same i cant seem to look for the lines and post only that data.

The Statement File looks like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>Statement: 663525 - Tested Tester</title>
    <meta name="generator" content="">
    <link rel="help" href="">
    <style type="text/css" media="screen">
    <!--
    td { font: 8pt Tahoma,Arial; }
    //-->
    </style>
    <style type="text/css" media="print">
    <!--
    td { font: 7pt Tahoma,Arial; }
    //-->
    </style>
    <style type="text/css">
    <!--
    .msdate { mso-number-format:"General Date"; }
    .mspt   { mso-number-format:\#\,\#\#0\.00;  }
    //-->
    </style>
  </head>
<body topmargin=1 marginheight=1>
<div align=center>
<div style="font: 20pt Times New Roman"><b>Statement 2012-05-29</b></div>
<br>


<table width="661" border=0 cellpadding=3 cellspacing=1>
<tr align=left>
    <td colspan=2><b>Account: 663525</b></td>
    <td colspan=6><b>Nam: Test Tester</b></td>
    <td colspan=2><b>Account Type: Savings</b></td>
    <td colspan=3 align=right><b>2012 May 16, 10:05</b></td></tr>

<tr align=left><td colspan=13><b>Closed Transactions:</b></td></tr>
<tr align=center bgcolor="#C0C0C0">
   <td width="52">Transaction</td>
   <td width="73" nowrap>Time</td>
   <td width="61">Type</td>
   <td colspan="9">Item</td>
   <td width="50">Balance</td>
</tr>
<tr bgcolor=#E0E0E0 align=right><td title="[sl]">14597463</td><td class=msdate nowrap>2012.01.16 09:45</td>
  <td><div align="center">Debit</div></td>
  <td colspan="9" class=mspt><div align="left">Tested Item 1 </div></td><td class=mspt>-0.50</td></tr>
<tr align=right><td>14597478</td><td nowrap>2012.01.16 09:46</td>
  <td><div align="center">Credit</div></td>
  <td colspan="9" class=mspt><div align="left">Tested Item 2 </div></td><td class=mspt>19.00</td></tr>


<tr align=right>
    <td colspan=10>&nbsp;</td>
    <td colspan="2" class=mspt>Total</td>
    <td class=mspt>-430.13</td>
</tr>

<tr align=right>
    <td colspan=11 align=right><b>Closed P/L:</b></td>
    <td colspan=2 align=right title="Totals" class=mspt><b>-477.94</b></td>
</tr>

<tr align=left><td colspan=13><b>Summary:</b></td></tr>
<tr align=right>
    <td colspan=2><b>Deposit/Withdrawal:</b></td>
    <td colspan=2 class=mspt><b>21 991.48</b></td>
    <td colspan=4><b>Credit Facility:</b></td>
    <td width="106" class=mspt><b>0.00</b></td>
    <td colspan=4>&nbsp;</td></tr>

<tr align=right>
    <td colspan=2><b>Closed P/L:</b></td>
    <td colspan=2 class=mspt><b>-477.94</b></td>
    <td colspan=4><b>Floating P/L:</b></td>
    <td class=mspt><b>-1 428.16</b></td>
    <td colspan=2><b>Margin:</b></td>
    <td colspan=2 class=mspt><b>404.97</b></td></tr>

<tr align=right>
    <td colspan=2><b>Balance:</b></td>
    <td colspan=2 class=mspt><b>22 554.67</b></td>
    <td colspan=4><b>Equity:</b></td>
    <td class=mspt><b>21 126.51</b></td>
    <td colspan=2><b>Free Margin:</b></td>
    <td colspan=2 class=mspt><b>20 721.54</b></td></tr>

</table>
</div></body></html>

How can i read only the Balance and floating P/L lines data ?
is there a search i can use for this like search for the line that has that and go to the nect line and find the value

I want to post this statemnt on the web for each of my statements

Recommended Answers

All 2 Replies

Member Avatar for diafol

Can I ask why this data is in a static html file? Would it not be better coming from/ being stored in a DB?

i receive file in email from bank i already made program to extract and save to web folder via FTP - an dyes i agree it would be MUCH better to make link to db and extarct all i want from it :) ... in this case the bank not going to allow me access to teh accounts ... yet ... lol

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.