解决方案 »

  1.   

    把两个文件合并成一个不行吗,在sms.php 最底下引用include('./index.html');
    然后在index.html相应的部分直接<?php echo $a;?>就行吧
      

  2.   

    我是在index.html中把参数提交到php中然后进行判断,只有生成变量- -然后需要在html接受变量值
      

  3.   

    <html>
    <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-rc1.js"></script></head>
    <body><script type="text/javascript">
        $(document).ready(function(){
            $.ajax({
                url:"sms.php",
                type: "GET",
                dataType: "text",
                success: function(data){
                    alert(data);//$a的值
                }        })
        })
      
    </script>
    </body></html>
    sms.php :<?php
    $a = 'aaaa';
    echo $a;
    ?>