Ultrasonic sensors won't work separately

Sorry, I have only a bit experience using this Arduino and as well as writing programs;
I’m having a problem with programming
First, My arduino is suppose to get inputs from sensors
then once the sensors detect; the LED goes HIGH
Once it goes high, it suppose to send HTTP GET Request using function.
and i have PHP file which will update a record into the database within my wampserver

As a result, once the first sensor detected; all of the LED goes HIGH when it shouldnt
LED1 should be the only one it goes high

I think the problem is the Ultrasonic sensor which I’m not 100% sure what it actually does.

Here is my code:

#include <Ethernet.h>
#include <SPI.h>

#define trigPin1 13
#define echoPin1 12
#define trigPin2 11
#define echoPin2 10
#define trigPin3 9
#define echoPin3 8
#define led1 7
#define led2 6
#define led3 5

byte mac[] = {0xDE,0xAD,0xBE,0xEF,0xFE,0xED};
EthernetClient client;
EthernetServer server = EthernetServer(80);
IPAddress ip(192,168,0,196);

int state1=0;
int state2=0;
int state3=0;

int count1 = 0;
int count2 = 0;
int count3 = 0;

void setup() {
  Serial.begin(9600);
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
  pinMode(led1, OUTPUT);
  
  EthernetSetup();
}

void loop() 
{
  sensor1();
  sensor2();
  sensor3();
  delay(500);
}

void sensor1() {
  long duration1, distance1;
  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);
  duration1 = pulseIn(echoPin1, HIGH);
  distance1 = (duration1/2) / 29.1;
  if (distance1 < 13)  // This is where the LED On/Off happens
  { 
    count1++;
    if(count1>5 && state1==0) //subject to change due to seconds
    {
      state1 = 1;
      count1 = 0;
      SEND_TO_PHP(111);
      Serial.println(state1);
    }
  }
  else
  {
    if(state1==1) 
    { 
      state1 = 0; 
      count1 = 0; 
      SEND_TO_PHP(110); 
      Serial.println(state1);
    }
  }
  digitalWrite(led1,state1);
}

void sensor2() {
  long duration2, distance2;
  digitalWrite(trigPin2, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin2, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin2, LOW);
  duration2 = pulseIn(echoPin2, HIGH);
  distance2 = (duration2/2) / 29.1;
  if (distance2 < 13)  // This is where the LED On/Off happens
  {
    count2++;
    if(count2>5 && state2==0) //subject to change due to seconds
    {
      state2 = 1;
      count2 = 0;
      SEND_TO_PHP(211);
      Serial.println(state2);
    }
  }
  else
  {
    if(state2==1) 
    { 
      state2 = 0; 
      count2 = 0; 
      SEND_TO_PHP(210); 
      Serial.println(state2);
    }
  }
  digitalWrite(led2,state2);
}

void sensor3() {
  long duration3, distance3;
  digitalWrite(trigPin3, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin3, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin3, LOW);
  duration3 = pulseIn(echoPin3, HIGH);
  distance3 = (duration3/2) / 29.1;
  if (distance3 < 13)  // This is where the LED On/Off happens
  { 
    count3++;
    if(count3>1 && state3==0) //subject to change due to seconds
    {
      state3 = 1;
      count3 = 0;
      SEND_TO_PHP(311);
      Serial.println(state3);
    }
  }
  else
  {
    if(state3==1) 
    { 
      state3 = 0; 
      count3 = 0; 
      SEND_TO_PHP(310); 
      Serial.println(state3);
    }
  }
  digitalWrite(led3,state3);
}

void EthernetSetup()
  {
  if (Ethernet.begin(mac) == 0)
    Serial.println("Failed to configure Ethernet using DHCP");
  else Serial.println("Ethernet Begin (MAC) passed");

  Serial.print("Current IP : ");
  Serial.println(Ethernet.localIP());
  // give the Ethernet shield a second to initialize:*/
  delay(1000);
  Serial.println("connecting...");
  // if you get a connection, report back via serial:
  if (client.connect(ip,80))
    // IF successfully connected with server, then initialized by sending MAC and IP to the database.
    Serial.println("connected");
}

void SEND_TO_PHP(int data){//HTTP request
  // SEND MAC ADDRESS AND IP to WEB SERVER
  Serial.println(data);
  //if(data==1) Serial.println("It is one");
  if (client.connect(ip,80))
    // IF successfully connected with server, then initialized by sending MAC and IP to the database.
    Serial.println("connected");
    
  switch(data)
  {
    case 111:client.println("GET /sensor/sensor.php?spot=PK1&level=1&data=1");break;
    case 110:client.println("GET /sensor/sensor.php?spot=PK1&level=1&data=0");break;
    case 211:client.println("GET /sensor/sensor.php?spot=PK2&level=1&data=1");break;
    case 210:client.println("GET /sensor/sensor.php?spot=PK2&level=1&data=0");break;
    case 311:client.println("GET /sensor/sensor.php?spot=PK3&level=1&data=1");break;
    case 310:client.println("GET /sensor/sensor.php?spot=PK3&level=1&data=0");break;
    default:Serial.println("Error");
  }
  
  client.println(" HTTP/1.1");
  client.println("Host: localhost");
  client.println("Accept: text/html");
  client.println("Connection: close");
  client.println();
  Serial.println();
  Serial.println("data sent");
  readc();
  data = 0;
  client.flush();
  client.stop();
}
void readc()
{
  int a = 0;
  while (client.connected())
  { 
     if (client.available())
     { 
       char c = client.read();
       Serial.print(c);
     }   
  }
}

and the output comes out as

Ethernet Begin (MAC) passed       //
Current IP : 192.168.0.199                           // connection part
connecting...                                                   //
connected
311                   // it triggers the 3rd ultrasonic sensor when the detection was from the 1st ultrasonic sensor

data sent
1 record updated1
211                 //  it triggers the 2nd ultrasonic sensor when the detection was from the 1st ultrasonic sensor
connected

data sent
1 record updated1
111                 // it finally triggers the 1st ultrasonic sensor
connected

data sent
1 record updated1
110
connected

data sent
1 record updated0
111
connected

data sent
1 record updated1
110
connected

data sent
1 record updated0

What a waste of code those three sensor functions do the same thing with different pins. Just pass in the pins to use as parameters to the function and use the same one.

Anyway in setup you only declair one of the trigger pins as an output you need to do them all.