Mudsaf Posted May 11, 2012 Share Posted May 11, 2012 Wondering how to get this to pure html code that works on page. For example <a href='http://www.facebook.com/#$LINK$' target='_blank'>ROFLCOPTER</a> The $LINK + text has been changed on that since i dont wan't to reveal code from my websites ATM im using $header1 = htmlspecialchars_decode($row1['$BLABLA$']); But its still pasting header like this on the page<a href='http://www.facebook.com/#LINK' target='_blank'>ROFLCOPTER</a> 2 Link to comment Share on other sites More sharing options...
Err Posted May 11, 2012 Share Posted May 11, 2012 Try html_entity_decode() instead. $header1 = html_entity_decode($row1[$BLABLHA],ENT_QUOTES)); Link to comment Share on other sites More sharing options...
Mudsaf Posted May 11, 2012 Author Share Posted May 11, 2012 (edited) No different effect since it decodes the HTML correctly but it won't show it as html. Instead it shows it like this <a href='http://www.facebook.com/#LINK' target='_blank'>ROFLCOPTER</a> Edited May 11, 2012 by Mudsaf Link to comment Share on other sites More sharing options...
Err Posted May 11, 2012 Share Posted May 11, 2012 Wondering how to get this to pure html code that works on page. No different effect since it decodes the HTML correctly but it won't show it as html. I'm confused. You say you want to decode it, but when it decodes the HTML, it now won't show the HTML? Link to comment Share on other sites More sharing options...
Mudsaf Posted May 11, 2012 Author Share Posted May 11, 2012 (edited) Yes thats correct Shows like this<a href='http://google.com' target='_blank'>http://google.com</a> when it should show it like thishttp://google.com/ PHP code looks like this (incase this helps you) include 'inc/yhdista_tietokanta.php'; //Conncets to DB$query1 = "SELECT * FROM $table$ WHERE $column$ = '$text$' ORDER BY $column$ DESC LIMIT 1";$query2 = "SELECT * FROM $table$ WHERE $column$ = '$text$' ORDER BY $column$ DESC LIMIT 1";$result1 = mysql_query($query1);$result2 = mysql_query($query2);if (!$result1 || !$result2) {echo "There was error, try again later.";} else {$row1 = mysql_fetch_array($result1);$row2 = mysql_fetch_array($result2);$header1 = html_entity_decode($row1['$column$'], ENT_QUOTES);$text1 = html_entity_decode($row1['$column$'], ENT_QUOTES);$header2 = html_entity_decode($row2['$column$'], ENT_QUOTES);$text2 = html_entity_decode($row2['$column$'], ENT_QUOTES);echo "Header: " . $header1 . " <br>Added: " . $row1['$column$'];echo "</span></span></span>";echo "<p>" . $text1 . "</p>";echo "</a><a href='#'class='klink'>Continue to ... $linkplace$ >></a> </span></span><br>"; blablablala until it closes tags } + php every tag inside $$ is correct information, but since i didin't want reveal site coding i added $$. ... Variables $something2 are used later with same method Mispelled "Should" so had to update Edited May 16, 2012 by Mudsaf Link to comment Share on other sites More sharing options...
Mudsaf Posted May 11, 2012 Author Share Posted May 11, 2012 (edited) Somehow i managed to ruin my whole database when trying to solve this . . . so lucky i've backed up this database/website few times. (Effect: Small rollback) -Somehow problem fixed with backup and other stuff dnno what the problem was but working now! Edited May 11, 2012 by Mudsaf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now