码迷,mamicode.com
首页 > Web开发 > 详细

php 根据传上来的信息,页面做出部分不同的显示

时间:2019-09-21 17:31:09      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:where   color   top   echo   amp   utf8   pos   ber   rect   

<?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>是真管理号,可信任!</span></p>";

                $trueHtml.=" <p><b>使用人:</b><span>";
                $trueHtml.="$sqlshiyong";
                $trueHtml.="</span></p>";



                $trueHtml .="<p><b>特别说明:</b><span>$sqlshuoming</span></p>";
                $trueHtml.="<p><a href=‘/jiarushequn‘>您还可直接联系各位管理的最新QQ &gt;&gt;</a></p>";
                $trueHtml .= "</div>";
                
            
        
            
        }else{
            $trueHtml ="<div class=‘result error‘>";
            $trueHtml.="<img src=‘/images/error.png‘ style=‘zoom:2;margin-top:0.5em;margin-bottom:0.5em;‘>";
            $trueHtml.=" <p><b>查询结果:</b><span><em class=‘number‘>$Haoma</em>是假管理号,不可信任<span></span></span></p>";
            $trueHtml.="<p><b>使用人:</b><span>无</span></p>";
            $trueHtml.="<p><b>特别说明:</b><span>请勿相信此人,以免上当受骗</span></p>";
            $trueHtml.="<p><a href=‘/jiarushequn‘>您还可直接联系各位管理的最新QQ &gt;&gt;</a></p>";
           

            
            $trueHtml.="</div>";
        }

    } else {
        echo( 1 );
    }
} else {
    echo( 2 );
}


?>

在html中,对应的显示的地方直接用$trueHtml代替

<div class="content" id="trueContent" >            <?php echo $trueHtml;?>
    </div>

 

php 根据传上来的信息,页面做出部分不同的显示

标签:where   color   top   echo   amp   utf8   pos   ber   rect   

原文地址:https://www.cnblogs.com/html5redbird/p/11563359.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!