Sending Data To Web Server By GSM Module Sim 808

Hi all
I'm trying to send any simple data from GSM Module sim 808 wired by Arduino uno to web server.
I created a database on the web server and PHP file to receive the data from Arduino .
I tested the codes but it didn't work and I don't know what's wrong?.
I Appreciate your help.
Thanks in advance.

Arduino code

 #include <SoftwareSerial.h>
SoftwareSerial gprsSerial(0, 1);

void setup()
{
  gprsSerial.begin(9600);
  Serial.begin(9600);

  Serial.println("Config SIM900...");
  delay(2000);
  Serial.println("Done!...");
  gprsSerial.flush();
  Serial.flush();

  // attach or detach from GPRS service 
  gprsSerial.println("AT+CGATT?");
  delay(100);
  toSerial();


  // bearer settings
  gprsSerial.println("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");
  delay(2000);
  toSerial();

  // bearer settings
  gprsSerial.println("AT+SAPBR=3,1,\"APN\",\"taif\"");
  delay(2000);
  toSerial();

  // bearer settings
  gprsSerial.println("AT+SAPBR=1,1");
  delay(2000);
  toSerial();
}


void loop()
{
   // initialize http service
   gprsSerial.println("AT+HTTPINIT");
   delay(2000); 
   toSerial();

   // set http param value
   gprsSerial.println("AT+HTTPPARA=\"URL\",\"testsim808.000webhostapp.com/write_data.php?data1=2.88&data2=2.93\""); 
   delay(2000);
   toSerial();

   // set http action type 0 = GET, 1 = POST, 2 = HEAD
   gprsSerial.println("AT+HTTPACTION=0");
   delay(6000);
   toSerial();

   // read server response
   gprsSerial.println("AT+HTTPREAD"); 
   delay(1000);
   toSerial();

   gprsSerial.println("");
   gprsSerial.println("AT+HTTPTERM");
   toSerial();
   delay(300);

   gprsSerial.println("");
   delay(10000);
}

void toSerial()
{
  while(gprsSerial.available()!=0)
  {
    Serial.write(gprsSerial.read());
  }
}

PHP Code

<?php
    // Prepare variables for database connection
    $dbusername = "id4660353_save";  // enter database username, I used "arduino" in step 2.2
    $dbpassword = "123456789";  // enter database password, I used "arduinotest" in step 2.2
    $server = "testsim808.000webhostapp.com"; // IMPORTANT: if you are using XAMPP enter "localhost", but if you have an online website enter its address, ie."www.yourwebsite.com"
    $My_db = "id4660353_save";
    // Connect to your database
    $dbconnect = mysql_pconnect($server, $dbusername, $dbpassword);
    $dbselect = mysql_select_db("id4660353_save",$dbconnect);
    // Prepare the SQL statement
    $sql = "INSERT INTO SAVE_DATA (Value_1, Value_2) VALUES ('".$_GET["data1"]."','".$_GET["data2"]."')";    
    // Execute SQL statement
    mysql_query($sql);
?>

I tested the codes but it didn't work and I don't know what's wrong?.

How are we to know what you know?

Your code produces serial output that you failed to share. Your code does something that you failed to share. Your code may actually be making contact with the web server, which should log that, and the issues, if any, related to that contact. You need to share that information.

Simply , My Arduino Code after uploading it should send two values to the database but it didn't happen and the database still empty . that is the problem.

Are you tracing your GPRS connection ?

Does the GSM board succeed to register on the GSM network ?

I would trace down each step of the process. Actualy, you're in the total ignorance where it hangs...

Yes the GSM board succeed to register on the GSM network, I tested this by another code for TCP connection, only my problem the data that was sent from the gps is displayed on the database , so please revise my arduino and PHP codes if there is Problem.

only my problem the data that was sent from the gps is not displayed on the database

Hi, Did you success in sending GPS data to server using GPRS