-
SitePoint Enthusiast
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?
-
SitePoint Enthusiast
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks