第一步:先在你创建的网站php上的根目录下创建一个html

 第二步:写上html代码  url地址改成你自己的名 (下面有代码)

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<body>
    <script>
        $.ajax({
            url:"http://my/index.php", 
            type:"GET",
            data:{
                name:'1234',
            },
            success:function(res){
                console.log(res);
            }
        })
    </script>
</body>
</html>

第三步:在你的index.php上写入这些   记得保存!!!

 第四步:把html加在网址上控制台就会打印出你写的东西   就完成了  

 

更多推荐

php实现前后端交互(示例步骤)(2)