Page is a not externally linkable
rocknbil - 10:11 pm on Dec 23, 2009 (gmt 0)
I'd do something more like this, but will add what a lot of people like - alternate color between rows. // Define these in your style sheet $output = NULL; Typed on the fly, may need some debugging . . .
Welcome aboard garywhite glw, there are many ways to do this. The prevous would never be my preference (sorry chasehx) becasue it switches between "plain output" and PHP with a high frequency, which makes it very hard to debug and follow in large acripts. create a table a single column, multi-row table to display visitors details.
$white_bg = 'white-bg'; // i.e., .white-bg { background:#fff; }
$gray_bg = 'gray-bg'; // i.e., .gray-bg { background:#d8d8d8; }
// Note also class "hd": .hd { background:#000; color:#fff; text-align:center; }
while($row=mysql_fetch_array($result)){
$thisClass=($thisClass==$gray_bg)?$white_bg:$gray_bg;
$output .= '
<tr>
<td class="' . $thisClass . '">' .
$row['Firstname'] . '<br>' .
'<a href="mailto:' .
$row['email'] . '">' .
$row['email'] . '</a><br>' .
$row['Phone'] . '</td>
</tr>';
}
if ($output) {
echo '
<table align="center">
<tr><td class="hd">Name,Email,Phone</td></tr>' .
$output .
'</table>';
}
else { echo '<p>Oops, no records found.</p>'; }