简体   繁体   中英

Using ajax to call php

I'm trying to call a php function to do some SQL stuff.

I've read on stack that it's possible, but only if I use ajax. So I've tried.

Here is the ajax :

$.ajax({ url: './put_in_table.php',
    type: 'get',
    success: function(output) {
        console.log(output);
    }
});

Unfortunately, It does nothing, and the output returned by the request is containing the PHP source code.

Php code is just a very simple test :

<?php
    echo "lol";
?>

Does anybody have an idea why the php is not executed? (It only contains an echo ). Thanks in advance.

如果您的php代码未解析但返回,则在服务器上安装php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM