faraz Posted February 5, 2010 Report Posted February 5, 2010 HI I added below code in new page, but it doesn't work : <center><h2>Recent Arrivals</h2> <?php if(!$reports) { echo 'No reports have been filed';return; } <table border="0.5" width="100%"> <td align=center><b>FL.Number</b></td> <td align=center><b>Pilot Name</b></td> <td align=center><b>From</b></td> <td align=center><b>To</b></td> <td align=center><b>Aircraft</b></td> <td align=center><b>Status</b></td>"; foreach($reports as $report) { <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->code $report->flightnum </td> <td bgcolor=#EBEEEF width=10% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->firstname $report->lastname</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->depicao</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->arricao</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->aircraft</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>Landed</td>; } </table> ?></center> Parse error: syntax error, unexpected '<' in /home/xx/public_html/xxx/core/pages/test2.htm on line 12 Quote
Administrators simpilot Posted February 5, 2010 Administrators Report Posted February 5, 2010 You have a ton of html mixed in with php. You need to open and close php code sections and use html between them or use echo commands with your html enclosed within the statement. echo 'my html code'; What are you using for an editor as most decent IDE's should be showing most of these errors without having to search for them. Quote
faraz Posted February 8, 2010 Author Report Posted February 8, 2010 Please see below code : <center><h2>Recent Arrivals</h2> <?php if(!$reports) { echo 'No reports have been filed';return; } echo "<table border="0.2" width="60%"><tr> <td align="center"><b>Fl. Number</b></td> <td align="center"><b>Pilot Name</b></td> <td align="center"><b>From</b></td> <td align="center"><b>To</b></td> <td align="center"><b>Aircraft</b></td> <td align="center"><b>Status</b></td></tr>"; foreach($reports as $report) { echo "<tr> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->code $report->flightnum </td> <td bgcolor=#EBEEEF width=10% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->firstname $report->lastname</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->depicao</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->arricao</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->aircraft</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>Landed</td></tr>"; } echo '</table>'; ?></center> when I insert that code in new page , Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/xxx/public_html/core/pages/test.htm on line 12 Quote
Members Vangelis Posted February 9, 2010 Members Report Posted February 9, 2010 First this is a corect start and finish of the code but i dont think that is will show any data would you like to tell us what exacly do you want so that we can help you ? as far i understud you want something similar to this http://www.aviation-global-airways.com/index.php/pages/board <center><h2>Recent Arrivals</h2> </center> <?php if(!$reports) { echo 'No reports have been filed';return; } ?> <table border="0.5" width="100%"> <td align=center><b>FL.Number</b></td> <td align=center><b>Pilot Name</b></td> <td align=center><b>From</b></td> <td align=center><b>To</b></td> <td align=center><b>Aircraft</b></td> <td align=center><b>Status</b></td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->code $report->flightnum </td> <td bgcolor=#EBEEEF width=10% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->firstname $report->lastname</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->depicao</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->arricao</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>$report->aircraft</td> <td bgcolor=#EBEEEF width=5% height=5 align=left><font face=Verdana color=#7E7E7E size=1<td>Landed</td> </table> Quote
faraz Posted February 10, 2010 Author Report Posted February 10, 2010 Thank you vangelisb I want show Recent Reports in new page . similar to http://www.linkvirtual.info/phpvms/ (Recent Flights) Quote
faraz Posted February 11, 2010 Author Report Posted February 11, 2010 HI That code doesn't work for me and just show No reports have been filed . Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.