存储在数据库中的HTML在页面上显示为文本

时间:2017-09-26 17:00:44

标签: php database twitter-bootstrap laravel

我试图在bootstrap模式中显示存储在我的数据库中的TEXT作为TEXT。该代码段显示了我希望它显示的正确方式,该代码段中的所有HTML都是我将其存储在数据库中的方式。任何指针都会很棒......不知道从哪里开始。我可以将HTML粘贴到空白文档中,它将正确显示。它在我的应用程序中显示为文本。

谢谢!

<td align="center">
   <table style="table-layout:fixed;width:380px" border="0" cellspacing="0" cellpadding="0">
<tbody>
   <tr>
      <td>
         <pre style="width:380px">
         <div style="text-align:center"><img src="https://hdcontent.homedepot.com/eReceipt/Images/A10F9F74B02AEB4A9FCB403DB87D8B12.jpg"></div>
         <div style="text-align:center">&nbsp;</div>
         <div style="text-align:center"><span style="font-size:10.0pt;color:black">901 CIVIC DRIVE</span></div>
         <div style="text-align:center"><span style="font-size:10.0pt;color:black">NILES, IL 60714        847-967-3200</span></div>
         <div style="text-align:center">&nbsp;</div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  1907  00001  51555    09/25/17  12:07 PM</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  CASHIER DIANE</span></div>
         <div style="text-align:center">&nbsp;</div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  081099027833 4X8 ULTRALIT &lt;A&gt;          </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     1/2&quot;X4'X8' USG ULTRALIGHT DRYWALL</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     6@6.49                         38.94 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  751361490046 8FT CRNRBD &lt;A&gt;            </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     8' GALVANIZED DRYWALL CORNER BEAD</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     8@1.36                         10.88 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  081099000164 EZ SAND 45 &lt;A&gt;        6.98 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     18LB-EZ SAND-45MIN COMPOUND</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  081099000171 EZ SAND90 &lt;A&gt;         6.98 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     18LB-EZ SAND-90MIN COMPOUND</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  038662612088 P-FINISH TPE &lt;A&gt;      8.48 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     1-7/8&quot;X300' ULTATHIN MESH JOINT TAPE</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  081099015861 4.5 CT PLUS3 &lt;A&gt;     10.39 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     USG &#43;3 JC PIGMENTED BOX 4.5 GAL</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  764666103221 15/8CRDWSC5# &lt;A&gt;     13.65 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     1-5/8&quot; COARSE DRYWALL SCREW 5 LB</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  750298153253 2X4-96 STUD &lt;A&gt;           </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     2X4-96&quot; PRIME KD WHITEWOOD STUD</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     8@3.06                         24.48 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  621241102089 1X2X8 FVRR &lt;A&gt;            </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     1X2-8FT STRIP</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     3@0.97                          2.91 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  090489089597 LATH &lt;A&gt;             13.97 </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">     48&quot; WOOD LATH - 50 PC BUNDLE</span></div>
         <div style="text-align:center">&nbsp;</div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">                   SUBTOTAL        137.66</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">                   SALES TAX        14.11</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">                   TOTAL          $151.77</span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">  XXXXXXXXXXXX8796 VISA       </span></div>
         <div style="text-align:left"><span style="font-size:10.0pt;color:black">                              USD$ 151.77 </span></div>
         <div style="text-align:left">
         <span style="font-size:10.0pt;color:black">

1 个答案:

答案 0 :(得分:3)

使用i am st rugglin g hereX 代替factors :: Int -> [Int] factors n = [x | x <- [1..n], n `mod` x == 0] anagramEncode :: [Char] -> [Char] anagramEncode (x:xs) = if (length (factors (length xs))) == 4 then [k | k <- ???] else anagramEncode (xs ++ ['X']) 来显示您的文字。但是从文档中考虑这一点在回显应用程序用户提供的内容时要非常小心。在显示用户提供的数据时,始终使用转义的双花括号语法来防止XSS攻击。