I'm editing some more on this site I'm building, and I'm making it so at the end of a tutorial, it has a little 'Need help? Goto this topic' kind of thing.
Normally fine, just enter URL into database, retireve it, and paste it into the href of a hyperlink, right?
Well apparently not.
I've put the following URL into the database, and confirmed via PHPMyAdmin that is is there.
http://talkdev.com/showthread.php?p=57
Now, logically with this line:
Need help on this tutorial? <a href="'.$support_topic.'">Visit the support topic!</a>Should result in this:
Need help on this tutorial? <a href="http://talkdev.com/showthread.php?p=57">Visit the support topic!</a>
But no. Some reason it does this.
Need help on this tutorial? <a href="<">Visit the support topic!</a>
All I can say is 'WTF'.
Here is how I am retrieving it from the database.
$result = mysql_query("SELECT * FROM `tutorials` WHERE id = '$_GET[tut]' ORDER BY id DESC") or die(mysql_error());
$tutorial = mysql_fetch_array($result);
$support_topic = $tutorial['support'];
Even just using 'echo $support_topic' gives me the '<'.
Using url_encode does nothing but give me '%3C'.
Any ideas what the hell this is all about?
I've done this with URLs before, using this line.
<a href="<?php echo $url.'">'.$url; ?></a>Same thing, only that one I had to echo the URL also so I simply used the '">' string on there instead of escaping PHP blocks that close together. Exact same thing though, and it works on that other script, but not this one.
Edited by Demonslay, 26 August 2006 - 12:48 PM.
