开发者

comparing Session-Value PHProblem

if ($_SESSION['user_email']!=$开发者_如何学编程_SESSION['ship_user_email'])
    {
        $to= $_SESSION['ship_user_email'];
        mail($to,$subject,$mail_html,$headers);
    }

there is problem in comparing values of both session. value is different but code not working.


print the values of both the session variables and check if there are leading or trailing spaces in the them.
Also check the condition with the '!==' as said by Kerry.
like this


if ( $_SESSION['user_email'] !== $_SESSION['ship_user_email'] )
    {
        $to= $_SESSION['ship_user_email'];
        mail($to,$subject,$mail_html,$headers);
    }


also check every step of your code by writing an echo statement and printing out the values of variables. This will help you debug and understand the code properly.


Try using the "!==" operator instead.


you can use <> this operator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜