Jump to content

Recommended Posts

Posted

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

  • Administrators
Posted

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.

Posted

Please see below code :

<center><h2>Recent Arrivals</h2>
<?php

if(!$reports)

{

echo 'No reports have been filed';return;

}

echo "<table border="0&#46;2" width="60%"><tr>
<td align="center"><b>Fl&#46; 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

  • Members
Posted

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>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...