0

Every time when I try to get data from Axios template its return data with all code and tag from Axios template.

<script src='assets/js/axios.min.js'></script>
<script src="assets/js/vue.js"></script>
<script src="assets/js/vue-router.js"></script>

<script>
    const APP = new Vue({

        el: '#app',

        methods: {
            showAllToDoList: function() {
                axios.get('inc/user.php').then(function(response) {
                    alert(response.data);
                });
            },
        },

        created: function() {
            this.showAllToDoList();
        }




    });
</script>

it's returned in alert like that. if I connect my database it shows all code like connection query everything.

<?php


echo "hi";
  • Can anyone help me – Munira_Akter May 10 '21 at 15:03
  • 1
    Please read the duplicate question. Your PHP code is not being executed, so has nothing to do with your javascript. Make sure the URL in your browser starts with `http`, not `file:///` to make sure the PHP code is being run through a webserver. If it is, then you need to make sure the webserver is properly configured. – aynber May 10 '21 at 15:04
  • Thanks, The problem was webserver is not config properly – Munira_Akter May 12 '21 at 09:48

0 Answers0