回应字符串返回的数字

时间:2013-04-01 03:16:53

标签: php

此代码由于某种原因返回为数字(其中“$ RTEXT”应该是); 有什么我想念的吗?愚蠢的错误?请帮忙。

    if($_POST['Action_3']){
    if(isset($_POST['act4_0'])){
    $rank = 0;
    $RTEXT = "Member";
    }elseif(isset($_POST['act4_1'])){
    $rank = 1;
    $RTEXT = "Graphic designer";
    }elseif(isset($_POST['act4_2'])){
    $rank = 2;
    $RTEXT = "Moderator";
    }elseif(isset($_POST['act4_3'])){
    $rank = 3;
    $RTEXT = "Administrator";
    }elseif(isset($_POST['act4_4'])){
    $rank = 4;
    $RTEXT = "Director of media";
    }elseif(isset($_POST['act4_5'])){
    $rank = 5;
    $RTEXT = "Community manager";
    }elseif(isset($_POST['act4_6'])){
    $rank = 6;
    $RTEXT = "Senior manager";
    }elseif(isset($_POST['act4_7'])){
    $rank = 7;
    $RTEXT = "Senior moderator/Admin";
    }
echo "<div style='float:left;margin:-660px 100px;min-width:760px;text-indent:190px;font-size:15px;'class='alert alert-success'><strong>Success!</strong> You have successfully changed (<b>" . $_POST['username'] . "'s</b>) rank to (<b>" . $RTEXT . "</b>). </div>";

2 个答案:

答案 0 :(得分:1)

也许你忘记在声明结尾处关闭if($ _ POST ['Action_3'])和}

答案 1 :(得分:0)

你尝试过吗? 回显每个$RTEXT

在每个条件内 首先看看它会下降的条件 然后查看它是否以字符串或整数形式返回$RTEXT的值?