SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Simple problem

  1. #1
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a troublesome yet simple problem. How would I insert a PHP variable (e.g. $print) into a standard text link? Thanks in advance for your help!

    -Colin

  2. #2
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a few ways. If you 'inside' the PHP script, you can do:

    echo "<a href=\"$url\">$name</a>";
    or
    printf('<a href="%s">%s</a>',$url,$name);

    If you are 'out' of the PHP script, you can use:
    <a href="<?=$url?>"><?=$name?></a>
    Of course, $url and $name would have to be predefined.

    Hope that was what you were looking for.





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
  •