Error Which am facing with my php code :-
    Notice: Undefined index: latitude in C:\xampp1\htdocs\tutorialspoint\pass.php on line 9
    Notice: Undefined index: longitude in C:\xampp1\htdocs\tutorialspoint\pass.php on line 10
     success
The following is the java code for passing the value to .php file:
public void writePost(double latitude,double longitude){
    String urlSuffix = "&latitude="+latitude+"&longitude="+longitude;
    class RegisterUser extends AsyncTask<String, Void, String> {
        @Override
        protected void onPostExecute(String s) {
            super.onPostExecute(s);
        }
        @Override
        protected String doInBackground(String... params) {
            String s = params[0];
            BufferedReader bufferedReader = null;
            try {
                URL url = new URL(GETWRITE_URL+s); //getwriteurl= url of ur php uptop .php
                HttpURLConnection con = (HttpURLConnection) url.openConnection();
                con.setDoInput(true);
                bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));
                String result;
                result = bufferedReader.readLine();
                return result;
            }catch(Exception e){
                return null;
            }
        }
    }
    RegisterUser ru = new RegisterUser();
    ru.execute(urlSuffix);
}
The following is my php code.Where I am accepting values from my android app.
 <?php
 $con=mysqli_connect("localhost","******","******","route69");
 if (mysqli_connect_errno($con))
 {
 echo "Failed to connect to MySQL: " . mysqli_connect_error();
 }
 $latitude = $_GET['latitude']; // accepting the current latitude from android app
 $longitude = $_GET['longitude'];//accepting the current longitude from android app
 $check = "INSERT INTO taxi1(Latitude, Longitude) values('$latitude','$longitude')";
 $result = mysqli_query($con,$check);
 if(isset($result)){
 echo "success";
 } else {
 echo "failed";
 }
 mysqli_close($con);
 ?>
Please Suggest me on How to fix the problem ?.
 
     
    