SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Simple problem
-
Jan 28, 2001, 19:59 #1
- 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
-
Jan 28, 2001, 21:10 #2
- 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