SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with creating dynamic URL or href link

    Hi,

    Below code works...
    $navigationpath="";
    $navtext="x1";
    $navigationpath = $navigationpath."> <a href=/".$navtext." STYLE=text-decoration:none>".$navtext."</a> ";
    echo $navigationpath; //displays http://yoursitename/x1

    Then why doesn't below work?
    $navigationpath="";
    $navtext="x1";
    $hlink="";
    $hlink=$hlink."/".$navtext;
    $navigationpath = $navigationpath."> <a href=/".$hlink." STYLE=text-decoration:none>".$navtext."</a> ";
    echo $navigationpath; //displays http://x1

    Any help?

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have used like
    $hlink=$hlink.$navtext."/";
    ?>
    <a href=/"<?php echo $hlink; ?>" STYLE=text-decoration:none><?php echo $navtext; ?></a>
    <? php....

    but then it gives URL as http://yoursitename/%22x1%22

    Now how to remove %22 from URL?


Bookmarks

Posting Permissions

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