我如何在PHP内部使用

时间:2016-02-01 05:52:47

标签: php html

如果><"你能纠正我的PHP代码吗? 我可以获得$ tte in if按钮

   if  (isset($_POST["but"])){
    $check = $_POST["text"];
    if(!empty($check)){
        if ($check == "test"){

            echo '
<form name="invite" method="POST" >"
<div id="wb_Text1" style="position:absolute;left:158px;top:106px;width:250px;height:22px;z-index:0;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:19px;"><strong>Are you want join clan</strong></span></div>
<input type="submit" id="Button2" name="yes" value="Yes" style="position:absolute;left:284px;top:186px;width:124px;height:59px;z-index:1;">
<input type="submit" id="Button3" name="no" value="No" style="position:absolute;left:148px;top:186px;width:124px;height:59px;z-index:2;">
</form>
';
$tte = '3333';
die;

if  (isset($_POST["yes"])){
    echo $tte;
}

    }
}
}

1 个答案:

答案 0 :(得分:0)

这会对你有所帮助。使用java脚本进行客户端显示是或否。去掉骰子(不需要)。

<?php 
if  (isset($_POST["but"]))
{
    $check = $_POST["text"];
    if(!empty($check))
    {
        if ($check == "test")
        {
            echo '
                    <form name="invite" method="POST" >"
                    <div id="wb_Text1" style="position:absolute;left:158px;top:106px;width:250px;height:22px;z-index:0;text-align:left;">
                    <span style="color:#000000;font-family:Arial;font-size:19px;"><strong>Are you want join clan</strong></span></div>
                    <input type="submit" id="Button2" name="yes" value="Yes" onclick="btnClicked(this.value);" style="position:absolute;left:284px;top:186px;width:124px;height:59px;z-index:1;">
                    <input type="submit" id="Button3" name="no" value="No" onclick="btnClicked(this.value);" style="position:absolute;left:148px;top:186px;width:124px;height:59px;z-index:2;">
                    </form>
                    ';
            ;        
        }
    }
}
?>
<script type="text/javascript">
function btnClicked(value)
{
    alert('your press '+value);
}
</script>