Why won't my arduino code upload data to database>?

Hi,

Small task - trying to write data created via arduino to a text file using php.

What would the correct syntax be please?

Arduino code:

if (client.connect(host, 80))
    {

      Serial.println("\nConnected to database...");

      client.print("GET /send_data.php?latitude=");
      Serial.print("GET /send_data.php?latitude=");
      client.print(latitude);
      Serial.print(latitude);
      client.print("&longitude=");
      Serial.print("&longitude=");
      client.print(longitude);
      Serial.print(longitude);
      client.println("HTTP/1.1\r\n");
      client.println("Host: 192.168.0.11"); // SERVER ADDRESS
      client.println("Content-Type: text/php" );
      client.println("Connection: close");
      client.println();
      client.println();
      x++;
    }

PHP code:

<?php
//require("config.php");
$dbHost = "localhost";
$dbUsername = "root";
$dbPassword = '';
$dbName = "map1";

// Opens a connection to a MySQL server
$connection = mysqli_connect($dbHost, $dbUsername, $dbPassword, $dbName); 
if (!$connection) {
die('Not connected : Ah shit ' . mysqli_error());
}

//Set the active MySQL database
$db_selected = mysqli_select_db($connection, $dbName );
if (!$db_selected) {
 die ('Can\'t use db : ' . mysqli_error());
}


//$request = $_GET['request'];

//$sql = "INSTERT INTO request.request (request) 
//VALUES ('$request', '$request', '$request', '$request', '$request')";

$latitude = $_GET["latitude"];
$longitude = $_GET["longitude"];

//TEST to see if values received. 
$file = "testfile.txt"; 
file_put_contents($file,$latitude);
file_put_contents($file,$longitude);

$myfile = fopen("testfile.txt", "w");
fwrite($myfile,$latitude);
fwrite($myfile,"\n");
fwrite($myfile,$longitude);
fwrite($myfile,"\n");
fclose($myfile);

//INSERT into SQL database
$sql = "INSERT INTO markers (name, address, lat, lng, type)
VALUES ('GPSname', 'GPSaddress','$latitude','$longitude', 'GPStype')";



// VALUES ('GPS', 'GPS','".$GET["latitude"]."','".$_GET["longitude"]."', 'GPS');

//Checks to see if new record made
if (mysqli_query($connection, $sql)) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "
" . mysqli_error($connection);
}

mysqli_close($connection);
?>

Nothing writes to the text file "testfile.txt" for some reason? If I manually run my php script in browser and plug in values, it writes to text file.

Cheers in advance