Take a value in php page sent with jquery function

前端 未结 1 637
遥遥无期
遥遥无期 2021-01-29 05:42

In this html page at the begin of the script i send the value of variable fin at the php page (http://sat3.altervista.org/index.php?valore=\"+ fin). In this php page i tried to

相关标签:
1条回答
  • 2021-01-29 06:37

    jQuery reference here http://api.jquery.com/jQuery.getJSON/ says that second argument is "A plain object or string that is sent to the server with the request."

    Try this:

    <script type="text/javascript">
    var fin = "SAT000000002575",
    url = "http://sat3.altervista.org/index.php",
    getVars = {
        valore : fin
    };
    
    $.getJSON(url, getVars, function(data) {
        // rest of your code
    });
    
    </script>
    

    And let us know :)

    EDIT

    Regarding your PHP code, you have to put this $myValue = $_GET["valore"]; before your while begins.

    0 讨论(0)
提交回复
热议问题