Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Iowa City, IA
    Thanked 5 Times in 5 Posts

    Creating a QuickLink table using achors


    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:
    PHP Code:
    echo "<center><font size='5'><em><u>Quick Links</u></em></font></center><br>";
    '<table align="center">';

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

    $anchor $array[$i];

        if (!
    strpos($i 4".") > 0) {
    '<td style="text-align:center"><a href="#"' $anchor '>' 
    strtoupper(substr($anchor0strlen($anchor) - 4)) . '</a></td>'; } 
        else { echo 
    '<td style="text-align:center"><a href="#"' $anchor '>' .
    strtoupper(substr($anchor0strlen($anchor) - 4)) . '</a></td>'; }
    the portion giving my trouble is this:
    PHP Code:
    <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:
    PHP Code:
    <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...
    Last edited by ajetrumpet; Sep 5th, 2009 at 01:34 AM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts