I have this AJAX sign up form, and I want to make a gear wheel play like that
whenever the server has signed up i want this bar to change to green, so what's I've done is echo the names of the function I wanted to call like so:
            echo "passed";
            if ($query = $sql->prepare("INSERT INTO business(password , username , bname) VALUES(? , ? , ?)")) {
                $query->bind_param("sss" , $password , $username , $bname );
                $query->execute();
            } else {
                printf("ErrorMessage: %s \n" , $sql->error);
            }
            if ($query2 = $sql->prepare("INSERT INTO user_business_data(email , firstname) VALUES(? , ? )")) {
                $query2->bind_param('ss' , $email , $firstname);
                $query2->execute();
            } else {
                printf('ErrorMessage: %s\n' , $sql->error);
            }
            $query3 = mysqli_query($sql ,"INSERT INTO user_time_stamp_business(time_stamp) VALUES (CURRENT_TIMESTAMP)");
            $query2->close();
            $query->close();
            $sql->close();
            if ($query && $query2) {
                sleep(3);
                echo "success";
                exit;
            } 
                            if (http.responseText == "passed") {
                            works();
                            document.getElementById("main-container").style.transform = "translateY(8%)";
                        } else if (http.responseText == "success") {
                            document.getElementById("alert").style.backgroundColor = "green";
                        }
The problem is that it creates a long string AND that it all comes together and not "passed" alone and "success" after
 
     
     
    