...

View Full Version : Creating a QuickLink table using achors



ajetrumpet
09-05-2009, 01:24 AM
all,

trying to create a small table at the top of a website log page to give the viewers quicklinks that are tied to anchors on the page. I am storing the log file names in PHP vars and I'm trying to concat them into the <a> tag within the echo statements of my table. here is some of my code:
//THIS SECTION IS FOR QUICKLINKS AT THE TOP OF THE PAGE...
//JUMP TO SPECIFIC PAGE SECTIONS OF THE ACTIVITY REPORT...
echo "<center><font size='5'><em><u>Quick Links</u></em></font></center><br>";
echo '<table align="center">';
echo '<tr>';

foreach ($array as $i => $value) {

$anchor = $array[$i];

if (!strpos($i / 4, ".") > 0) {
echo '</tr>';
echo '<tr>';
echo '<td style="text-align:center"><a href="#"' . $anchor . '>' .
strtoupper(substr($anchor, 0, strlen($anchor) - 4)) . '</a></td>'; }
else { echo '<td style="text-align:center"><a href="#"' . $anchor . '>' .
strtoupper(substr($anchor, 0, strlen($anchor) - 4)) . '</a></td>'; }
}
echo '</table>';
echo '<br><br><br>';the portion giving my trouble is this:
<a href="#"' . $anchor . '>'[/code]instead of this address comming out as myDomain.com/page.php#AchorName, I am only getting this: myDomain.com/page.php#. Can anyone give me a boost here? Been at it for awhile, and I'm getting a bit buggy....thanks!

as it stands right now, the anchor names have the string .txt in them. is that the problem possibly? if so, I can cut the last four chars off of it...


i just looked at the page source too....and here is a sample table cell that it is writing:
<td style="text-align:center"><a href="#"about.txt>ABOUT</a></td>i can see what's its doing, but can't quite gather what to do about it...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum