0

由于某种原因,此代码作为数字返回(应该是“$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>";
4

2 回答 2

1

也许您忘记在语句末尾用 } 关闭 if($_POST['Action_3'])

于 2013-04-01T03:52:35.770 回答
0

你有没有尝试回应每一个$RTEXT

在每个条件中首先查看它将落在哪个条件下,然后查看它返回的值$RTEXT是字符串还是整数?

于 2013-04-01T03:39:03.540 回答