Hello and welcome to our community! Is this your first visit?
Register
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
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts

    Creating a QuickLink table using achors

    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:
    PHP 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($anchor0strlen($anchor) - 4)) . '</a></td>'; } 
        else { echo 
    '<td style="text-align:center"><a href="#"' $anchor '>' .
                   
    strtoupper(substr($anchor0strlen($anchor) - 4)) . '</a></td>'; }
                                     }
    echo 
    '</table>';
    echo 
    '<br><br><br>'
    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; 09-05-2009 at 02: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
  •