Passing values from JavaScript to PHP using AJAX

前端 未结 4 1399
小鲜肉
小鲜肉 2020-12-22 07:12

I don\'t know why my code is not working, I am trying to send the coordinates from JavaScript to PHP using AJAX and I am able to pull values from JavaScript to textbox but v

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 07:25

    First off, separate the PHP processing. Now after getting the location using the callback then perform the AJAX. Sample Code:

    samepage3.php

    
    
    
    
    
    

    request.php

     $lat, 'lon' => $lon));
        exit;
    }
    ?>
    

提交回复
热议问题