<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Echo a variable in PHP which displays as a link</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/echo-a-variable-in-php-which-displays-as-a-link/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/echo-a-variable-in-php-which-displays-as-a-link/</link>
	<description></description>
	<lastBuildDate>Thu, 20 Jun 2013 04:39:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: yuvalshavit</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/echo-a-variable-in-php-which-displays-as-a-link/#comment-54283</link>
		<dc:creator>yuvalshavit</dc:creator>
		<pubDate>Mon, 30 Jun 2008 18:42:18 +0000</pubDate>
		<guid isPermaLink="false">#comment-54283</guid>
		<description><![CDATA[The code seems okay to me.  Are you sure $url has a value?  PHP doesn&#039;t require you to pre-declare all values, so if you mistyped $url when you assigned it a value, it could be uninitialized (and thus default to an empty string) here.  It could also be a scoping issue; if $url is a global value, remember to declare &quot;global $url&quot; in the function. And if you&#039;re getting the value from a database query, make sure the query is correctly returning a value;  if it doesn&#039;t, $row[&#039;url&#039;] (or whatever it is) will not be set and will thus default to an empty string. You can test this by doing something like:  &lt;pre&gt;$url=isset($row[&#039;url&#039;])? &#039;[&#039;.$row[&#039;url&#039;].&#039;]&#039; : &quot;[UNDEFINED_URL]&quot;; &lt;/pre&gt;

Does it output something like this?

&lt;pre&gt;&lt;p&gt;Name Genre Bio &lt;a href=&#039;&#039;&gt; Profile&lt;/a&gt;&lt;/pre&gt;

If so, I&#039;d check to make sure you&#039;re correctly assigning $url a value. Otherwise, I&#039;ve run out of ideas, sorry.  HTH!]]></description>
		<content:encoded><![CDATA[<p>The code seems okay to me.  Are you sure $url has a value?  PHP doesn&#8217;t require you to pre-declare all values, so if you mistyped $url when you assigned it a value, it could be uninitialized (and thus default to an empty string) here.  It could also be a scoping issue; if $url is a global value, remember to declare &#8220;global $url&#8221; in the function. And if you&#8217;re getting the value from a database query, make sure the query is correctly returning a value;  if it doesn&#8217;t, $row['url'] (or whatever it is) will not be set and will thus default to an empty string. You can test this by doing something like:
<pre>$url=isset($row['url'])? '['.$row['url'].']' : "[UNDEFINED_URL]"; </pre>
<p>Does it output something like this?</p>
<pre>&lt;p&gt;Name Genre Bio &lt;a href=''&gt; Profile&lt;/a&gt;</pre>
<p>If so, I&#8217;d check to make sure you&#8217;re correctly assigning $url a value. Otherwise, I&#8217;ve run out of ideas, sorry.  HTH!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: whiteyoh</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/echo-a-variable-in-php-which-displays-as-a-link/#comment-54279</link>
		<dc:creator>whiteyoh</dc:creator>
		<pubDate>Mon, 30 Jun 2008 16:55:09 +0000</pubDate>
		<guid isPermaLink="false">#comment-54279</guid>
		<description><![CDATA[it outputs $djname $genre and $biography fine, but i want a link to be displayed that takes you to their profile.  the url ($url)is stored in the table]]></description>
		<content:encoded><![CDATA[<p>it outputs $djname $genre and $biography fine, but i want a link to be displayed that takes you to their profile.  the url ($url)is stored in the table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yuvalshavit</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/echo-a-variable-in-php-which-displays-as-a-link/#comment-54278</link>
		<dc:creator>yuvalshavit</dc:creator>
		<pubDate>Mon, 30 Jun 2008 16:49:09 +0000</pubDate>
		<guid isPermaLink="false">#comment-54278</guid>
		<description><![CDATA[What does it output now?]]></description>
		<content:encoded><![CDATA[<p>What does it output now?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.013 seconds using memcached
Object Caching 296/299 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-20 04:52:26 -->