ElectricShaka Posted January 23, 2008 Share Posted January 23, 2008 I have html code like the following stored in a MySQL database. <style type="text/css">.fcsS{}</style> <style type="text/css"> td.columnsWidening img,td.columnsWidening {max-width:100% !important;width: expression(this.width > 400 ? 400 : true);} td.columnsWidening img,td.columnsWidening {max-width:100% !important;width: expression(this.width > 400 ? 400 : true);}</style><style type="text/css"> { Background Properties } table, tr, td { background-color:transparent; border:none; border-width:0;} body { background-color:c6c1c1; background-image:url('www.epiklayouts.com/images/carmen.jpg'); background-attachment:fixed; background-position:center center; background-repeat:repeat; border-top-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-width:0px; border-color:none; border-style:solid; padding-left:0px; padding-right:0px; } .FreeCodeSource.com { Table Properties } table table { border: 0px } table table table table{border:0px} table, tr, td { background-color:transparent; border:none; border-width:0;} table table table { border-style:solid; border-width:3; border-color:000000; background-color:C8C8C8; background-image:url('Enter Image URL'); background-repeat:repeat; background-attachment:fixed; background-position:top center; filter:alpha(opacity=80); -moz-opacity:0.80; opacity:0.80; -khtml-opacity:0.80; } table table table table td {filter:none;} { Text Properties } table, tr, td, li, p, div {} .btext, .orangetext15, .nametext, .whitetext12 { font-family:georgia !important; color:3C05A2 !important; font-weight:bold; font-style:italic; } .blacktext10, .blacktext11, .blacktext12, .lightbluetext8, .redtext, .redbtext, .text { color:3C05A2 !important; font-weight:bold; font-style:italic; } { Link Properties } a:active, a:visited, a:link { color:0000FF !important; font-weight:normal; font-style:italic; } a:hover {color:FFFFFF !import ant; font-weight:bold; font-style:italic; text-decoration:line-through; text-decoration:underline; } { Tweaks } </style><style type="text/css"> .commentlinks a { font-weight:normal; font-size:9px; } </style><style type=text/css> #tkn_leaderboard{visibility:visible !important; display:inline !important;} body TABLE TD DIV#header_gae { VISIBILITY: visible !important;} body DIV DIV select#profileaction{VISIBILITY: visible !important; display:inline !important; position:static; WIDTH: 125px !important;} body DIV DIV DIV#profilelinks{ VISIBILITY: visible !important; display:inline !important; position:static; padding-right:15px; } body DIV TABLE TD DIV#googlebar { VISIBILITY: visible !important; display:block !important; position:relative; z-index:1000; } body DIV DIV form #q, body DIV DIV form #t, body DIV DIV form #submitBtn, body DIV DIV form #imgGoogle { VISIBILITY: visible !important; display:inline !important; position:static; } </style><style type="text/css"> body, html {visibility:visible !important; display:block !important} </style> <br> <style type="text/css">.fcsE{}</style> <a href="http://www.epiklayouts.com" target=_blank>Myspace Layouts</a><br> <div style="position:absolute;left:0px;top:0px;width:88px;height:31px;"><a href="http://www.epiklayouts.com">EpikLayouts.com</a></div> This is my php code to pull the code from the database and print it in a text field. The problem is that not all the code shows up in the text field. Is there a command to tell the user's browser somehow to not read the html code as html code and just to read it as a long string? /* display theme code */ echo "<td align='center'><b>Theme Code</b>"; ?> <br/> <?php echo "<textarea rows='10' cols='40' name='themeCode' value='{$row['themeCode']}'</textarea></td>\n"; Here is what actually shows up for the user to see. You can see there is a lot missing from above. </style><style type="text/css"> .commentlinks a { font-weight:normal; font-size:9px; } </style><style type=text/css> #tkn_leaderboard{visibility:visible !important; display:inline !important;} body TABLE TD DIV#header_gae { VISIBILITY: visible !important;} body DIV DIV select#profileaction{VISIBILITY: visible !important; display:inline !important; position:static; WIDTH: 125px !important;} body DIV DIV DIV#profilelinks{ VISIBILITY: visible !important; display:inline !important; position:static; padding-right:15px; } body DIV TABLE TD DIV#googlebar { VISIBILITY: visible !important; display:block !important; position:relative; z-index:1000; } body DIV DIV form #q, body DIV DIV form #t, body DIV DIV form #submitBtn, body DIV DIV form #imgGoogle { VISIBILITY: visible !important; display:inline !important; position:static; } </style><style type="text/css"> body, html {visibility:visible !important; display:block !important} </style> <br> <style type="text/css">.fcsE{}</style> <a href="http://www.epiklayouts.com" target=_blank>Myspace Layouts</a><br> <div style="position:absolute;left:0px;top:0px;width:88px;height:31px;"><a href="http://www.epiklayouts.com">EpikLayouts.com</a></div>' For reference the page I'm currently working on can be found here if you select a category. http://www.epiklayouts.com/layouts.php Thanks for any help you can provide! Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 23, 2008 Share Posted January 23, 2008 To output literal HTML so that it is not rendered by the browser, use htmlentities() - http://us.php.net/htmlentities Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/#findComment-447235 Share on other sites More sharing options...
ElectricShaka Posted January 23, 2008 Author Share Posted January 23, 2008 So in my code value='{$row['themeCode']}' I want something like: value='htmlentities({$row['themeCode']})' That isn't fixing the problem though. Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/#findComment-447265 Share on other sites More sharing options...
legohead6 Posted January 23, 2008 Share Posted January 23, 2008 thake the single quotes away value= htmlentities({$row['themeCode']}); Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/#findComment-447309 Share on other sites More sharing options...
ElectricShaka Posted January 23, 2008 Author Share Posted January 23, 2008 That made most of the code show up thanks. However it still cuts out the very beginning of the code which should say: <style type="text/css"> This is what shows up now in full: .fcsS{}</style> <style type="text/css"> td.columnsWidening img,td.columnsWidening {max-width:100% !important;width: expression(this.width > 400 ? 400 : true);} td.columnsWidening img,td.columnsWidening {max-width:100% !important;width: expression(this.width > 400 ? 400 : true);}</style><style type="text/css"> { Background Properties } table, tr, td { background-color:transparent; border:none; border-width:0;} body { background-color:c6c1c1; background-image:url('http://epiklayouts.com/Myspacelayouts/sexygirls/alba1.jpg'); background-attachment:fixed; background-position:center center; background-repeat:repeat; border-top-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-width:0px; border-color:none; border-style:solid; padding-left:0px; padding-right:0px; } .FreeCodeSource.com { Table Properties } table table { border: 0px } table table table table{border:0px} table, tr, td { background-color:transparent; border:none; border-width:0;} table table table { border-style:solid; border-width:3; border-color:000000; background-color:C8C8C8; background-image:url('Enter Image URL'); background-repeat:repeat; background-attachment:fixed; background-position:top center; filter:alpha(opacity=80); -moz-opacity:0.80; opacity:0.80; -khtml-opacity:0.80; } table table table table td {filter:none;} { Text Properties } table, tr, td, li, p, div {} .btext, .orangetext15, .nametext, .whitetext12 { font-family:georgia !important; color:3C05A2 !important; font-weight:bold; font-style:italic; } .blacktext10, .blacktext11, .blacktext12, .lightbluetext8, .redtext, .redbtext, .text { color:3C05A2 !important; font-weight:bold; font-style:italic; } { Link Properties } a:active, a:visited, a:link { color:0000FF !important; font-weight:normal; font-style:italic; } a:hover {color:FFFFFF !import ant; font-weight:bold; font-style:italic; text-decoration:line-through; text-decoration:underline; } { Tweaks } </style><style type="text/css"> .commentlinks a { font-weight:normal; font-size:9px; } </style><style type=text/css> #tkn_leaderboard{visibility:visible !important; display:inline !important;} body TABLE TD DIV#header_gae { VISIBILITY: visible !important;} body DIV DIV select#profileaction{VISIBILITY: visible !important; display:inline !important; position:static; WIDTH: 125px !important;} body DIV DIV DIV#profilelinks{ VISIBILITY: visible !important; display:inline !important; position:static; padding-right:15px; } body DIV TABLE TD DIV#googlebar { VISIBILITY: visible !important; display:block !important; position:relative; z-index:1000; } body DIV DIV form #q, body DIV DIV form #t, body DIV DIV form #submitBtn, body DIV DIV form #imgGoogle { VISIBILITY: visible !important; display:inline !important; position:static; } </style><style type="text/css"> body, html {visibility:visible !important; display:block !important} </style> <br> <style type="text/css">.fcsE{}</style> <a href="http://www.epiklayouts.com" target=_blank>Myspace Layouts</a><br> <div style="position:absolute;left:0px;top:0px;width:88px;height:31px;"><a href="http://www.epiklayouts.com">EpikLayouts.com</a></div>) and this is what it should be: <style type="text/css">.fcsS{}</style> <style type="text/css"> td.columnsWidening img,td.columnsWidening {max-width:100% !important;width: expression(this.width > 400 ? 400 : true);} td.columnsWidening img,td.columnsWidening {max-width:100% !important;width: expression(this.width > 400 ? 400 : true);}</style><style type="text/css"> { Background Properties } table, tr, td { background-color:transparent; border:none; border-width:0;} body { background-color:c6c1c1; background-image:url('www.epiklayouts.com/images/carmen.jpg'); background-attachment:fixed; background-position:center center; background-repeat:repeat; border-top-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-width:0px; border-color:none; border-style:solid; padding-left:0px; padding-right:0px; } .FreeCodeSource.com { Table Properties } table table { border: 0px } table table table table{border:0px} table, tr, td { background-color:transparent; border:none; border-width:0;} table table table { border-style:solid; border-width:3; border-color:000000; background-color:C8C8C8; background-image:url('Enter Image URL'); background-repeat:repeat; background-attachment:fixed; background-position:top center; filter:alpha(opacity=80); -moz-opacity:0.80; opacity:0.80; -khtml-opacity:0.80; } table table table table td {filter:none;} { Text Properties } table, tr, td, li, p, div {} .btext, .orangetext15, .nametext, .whitetext12 { font-family:georgia !important; color:3C05A2 !important; font-weight:bold; font-style:italic; } .blacktext10, .blacktext11, .blacktext12, .lightbluetext8, .redtext, .redbtext, .text { color:3C05A2 !important; font-weight:bold; font-style:italic; } { Link Properties } a:active, a:visited, a:link { color:0000FF !important; font-weight:normal; font-style:italic; } a:hover {color:FFFFFF !import ant; font-weight:bold; font-style:italic; text-decoration:line-through; text-decoration:underline; } { Tweaks } </style><style type="text/css"> .commentlinks a { font-weight:normal; font-size:9px; } </style><style type=text/css> #tkn_leaderboard{visibility:visible !important; display:inline !important;} body TABLE TD DIV#header_gae { VISIBILITY: visible !important;} body DIV DIV select#profileaction{VISIBILITY: visible !important; display:inline !important; position:static; WIDTH: 125px !important;} body DIV DIV DIV#profilelinks{ VISIBILITY: visible !important; display:inline !important; position:static; padding-right:15px; } body DIV TABLE TD DIV#googlebar { VISIBILITY: visible !important; display:block !important; position:relative; z-index:1000; } body DIV DIV form #q, body DIV DIV form #t, body DIV DIV form #submitBtn, body DIV DIV form #imgGoogle { VISIBILITY: visible !important; display:inline !important; position:static; } </style><style type="text/css"> body, html {visibility:visible !important; display:block !important} </style> <br> <style type="text/css">.fcsE{}</style> <a href="http://www.epiklayouts.com" target=_blank>Myspace Layouts</a><br> <div style="position:absolute;left:0px;top:0px;width:88px;height:31px;"><a href="http://www.epiklayouts.com">EpikLayouts.com</a></div> Thank you so much for your help. Any advice on that first line? Again here is my code: /* display theme code */ echo "<td align='center'><b>Theme Code</b>"; ?> <br/> <?php echo "<textarea rows='10' cols='40' name='themeCode' value=htmlentities({$row['themeCode']})</textarea></td>\n"; Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/#findComment-447355 Share on other sites More sharing options...
PFMaBiSmAd Posted January 24, 2008 Share Posted January 24, 2008 Here is an example for the syntax of a textarea - http://w3schools.com/html/showit.asp?filename=tryhtml_textarea There is no value='...' parameter. The content goes between the <textarea> and </textarea> tags. Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/#findComment-447361 Share on other sites More sharing options...
ElectricShaka Posted January 24, 2008 Author Share Posted January 24, 2008 Thank you very much. That fixed it. Link to comment https://forums.phpfreaks.com/topic/87444-solved-how-to-display-html-code-in-an-echo-command/#findComment-447363 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.