samedi 29 septembre 2018

checking value of if conditino isn't printing correct output

I am working on a chat room and the condition i want to implement is: when user send both file and text message it will return an error.

but this isn't working correct.

this is my code

if($_FILES['chat_upload_file']){

                echo "You are in file checking<br/>";
                echo $text_message;
                if($text_messege){
                    echo "It's in IF<br/>";
                    $error = 1;
                    $error_msg = "Either Sender can send file or text";
                    exit(0);
                }
                else{

                    echo "it's in else<br/>";
                    exit(0);

}

the output that i want is from internal IF : It's in IF

but the output is : It's in else

Aucun commentaire:

Enregistrer un commentaire