marksie1988 Posted July 19, 2007 Share Posted July 19, 2007 ok i have a script which shows news on my webpage when a user clicks a link from my rss feed. but if the news has any links within it it will not link them why is this? i think i need to change this row $news = nl2br (strip_tags ($row['newstext'], '<a><b><i><u>')); but i dont know what to... here is the full php so you can understand the script. <?php if(ctype_digit($_GET['id'])) $article_id = $_GET['id']; else $article_id = 0; $query = "SELECT * FROM `news` WHERE `id` = '" . $article_id . "' LIMIT 1;"; $result = mysql_query($query); if(mysql_num_rows($result) == 0) { echo "<h5 class=\"style2\">There is no news with this article id</h5>"; } else{ while ($row = mysql_fetch_assoc ($result)) { /* place table row data in * easier to use variables. * Here we also make sure no * HTML tags, other than the * ones we want are displayed */ $date = date("D d M Y h:i:s e", $row['postdate']); $title = htmlentities ($row['title']); $news = nl2br (strip_tags ($row['newstext'], '<a><b><i><u>')); /* display the data */ $td = "<td align=\"left\" >"; $ttl = "align=\"center\" style=\"font-size:13px; color:#ffffff; font-family:tahoma\""; $dte = "align=\"center\" style=\"font-size:10px; color:#CA3C30; font-family:tahoma\""; $nws = "align=\"center\" style=\"font-size:12px; color:#999999; font-family:tahoma\""; echo "<strong $ttl> \n $title </strong>\n <br>\n"; echo "<strong $dte> \n $date </strong>\n <br><br>\n"; echo "<strong $nws> \n $news </strong>\n <br><br>\n"; } } ?> help would be appreciated Quote Link to comment Share on other sites More sharing options...
marksie1988 Posted July 21, 2007 Author Share Posted July 21, 2007 does no body know how i can do this?? please help me out here? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.