HTTP POST GET problem probably the server

when you manually type the url with parameter info are you typing "SET"?

That which works does not look like

which does not work.

Here they have an example with query string, without sending any headers, does that work? WiFi - WiFiClient() - Arduino Reference or is it a different client?

i just type "localhost/sais/addd.php?h=34&t=22" nothing more

what do you mean " that which works does not look like " ?

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "Redmi";          //  your network SSID (name)
char pass[] = "Hammed2003";   // your network password

int status = WL_IDLE_STATUS;
IPAddress server(74,125,115,105);  // Google

// Initialize the client library
WiFiClient client;

void setup() {
  Serial.begin(9600);
  Serial.println("Attempting to connect to WPA network...");
  Serial.print("SSID: ");
  Serial.println(ssid);

  status = WiFi.begin(ssid, pass);
  if ( status != WL_CONNECTED) {
    Serial.println("Couldn't get a wifi connection");
    // don't do anything else:
    while(true);
  }
  else {
    Serial.println("Connected to wifi");
    Serial.println("\nStarting connection...");
    // if you get a connection, report back via serial:
    if (client.connect(server, 80)) {
      Serial.println("connected");
      // Make a HTTP request:
      client.println("GET /search?q=arduino HTTP/1.0");
      client.println();
    }else {
      Serial.println("failed to connect to the server");
    }
  }
}

void loop() {

}

image

maybe google ip address has changed.. try connecting to your server with this code

changed it, the same error

my mistake, it working with my server

And you see q=arduino query string on the server side?

what do you mean "see q=arduino query on the server side?" ?

this example code sends the query string q=arduino

client.println("GET /search?q=arduino HTTP/1.0");

Do you see this in PHP?

does localhost/sais/addd.php?h=34&t=22 look like GET /sais/added.php?h=65&t=22.9?

When you type GET /sais/added.php?h=65&t=22.9 into the browser does it work?

no, obviously, so you mean i should be sending localhost/sais/addd.php?h=34&t=23 from arduino

to my knowledge, the arduino is not calling any php file so i dont think i can read query anywhere

Sorry, this example code connects to your server where your php lives. So arduino is calling your php. Same as your code before, just shorter example easier to debug...

there is a lot of php files on my server, so i dont know which one to look into that why in my former code i have

const String head="GET /sais/addd.php?";

ok, change the example to /sais/addd.php?q=arduino this way you connect to your addd.php and can examine the query string now with this shorter example from arduino reference webiste

still nothing
image

hold on, what is this? are you opening addd.php in browser and want to see what arduino sent to it? to see the request arduino sent to it you need to read the server response on arduino and serial.print it, is that what you're doing?

What happened when you tried?