<?php $con = mysql_connect( "127.0.0.1", "xxxx", "password" ); mysql_query("set names 'utf8' "); mysql_query("set character_set_client=utf8"); mysql_query("set character_set_results=utf8"); if ( $con ) { $tag = mysql_select_db( "sql_name", $con ); if ( $tag ) { $Haoma = $_POST[ "haoma" ]; $trueHtml =""; $row=mysql_fetch_array(mysql_query( "SELECT * FROM `sqlform` where `haoma` = '".$Haoma."' ")); $sqlhaoma = $row['haoma']; $sqlshiyong = $row['shiyong']; $sqlshuoming = $row['shuoming']; //var_dump($row); if($sqlhaoma == $Haoma){ $trueHtml = "<div class='result correct'>"; $trueHtml .=" <img src='/images/correct.png' style='zoom:2;margin-top:0.5em;margin-bottom:0.5em;'>"; $trueHtml .= " <p>"; $trueHtml .= "<b>"; $trueHtml.="查询结果:"; $trueHtml.="</b>"; $trueHtml.="<span>"; $trueHtml.="<em class='number'>"; $trueHtml.="$sqlhaoma"; $trueHtml.="</ em> is true management number, a trusted </ span> </ the p-> "! =." <the p-> <b> using human: </ b> <span>$ trueHtml; ; $ TrueHtml . = " $ Sqlshiyong " ; $ trueHtml . = "</ Span> </ P>" ; $ trueHtml . = "<P> <B> special instructions: </ B> <span> $ sqlshuoming </ span> </ the p-> " ; $ trueHtml =." <the p-> <a href='/jiarushequn'> You can also contact the latest QQ you manage gt &; & gt; </a> </ the p-> " ; $ trueHtml . = "</ div>" ; } the else { $ trueHtml = "<div class = 'Result error'>" ; $ trueHtml .="<img src='/images/error.png' style='zoom:2;margin-top:0.5em;margin-bottom:0.5em;'>"; $ trueHtml . = "<the p-> <b> query results: </ b> <span> <EM class = 'Number The'> $ Haoma </ EM> is false management number, can not be trusted <span> </ span> < / span> </ P> " ; $ trueHtml . =" <P> <B> using human: </ b> <span> no </ span> </ P> " ; $ trueHtml =." <P> < b> special Note: </ b> <span> Do not believe the person so deceived </ span> </ the p-> " ; $ trueHtml . =" <the p-> <a href='/jiarushequn'> You you can contact the management of the latest & gt QQ; & gt; </a> </ the p-> " ; $ trueHtml . =" </ div> " ; } } else { echo( 1 ); } } else { echo( 2 ); } ?>
In html, where instead of the corresponding display directly $ trueHtml
<div class="content" id="trueContent" > <?php echo $trueHtml;?> </div>