Arduino ethernet shied problem

Hi everyone, I am trying to receive data from my website through php code. Sometimes connection fails and I cannot receive anything. Sometimes I can receive data without any problem. I am using the get method to reach my server. What can cause that?

Thank you

Here is my code:

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

byte mac = { 0x90, 0xA2, 0xDA, 0x0D, 0x3F, 0x82 };
byte ip = { 192, 168, 0, 108 };
//byte gw= { 192, 168, 0, 1};
byte server = { 174, 120, 19, 60 }; // mywebsite
//byte subnet = { 255, 255, 255, 0};
int pin1=9;
int microid=12345;
int cur=1.8;

char response[256];
//function p
EthernetClient client;

void setup()
{
Ethernet.begin(mac, ip);
Serial.begin(9600);

delay(5000);

Serial.println(“connecting…”);

if (client.connect(server, 80)) {
Serial.println(“connected”);
client.print(“GET http://xxxxx.com/arduino/fetch.php”);
Serial.print(“GET http://xxxxx.com/arduino/fetch.php”);
// client.print(microid);
// Serial.print(microid);
// client.println(" HTTP/1.0");
client.println();
} else {
Serial.println(“connection failed”);
}
}

void loop()
{
while (client.available()) {
char c = client.read();
Serial.print(c);
}

while (!client.connected()) {
Serial.println();
Serial.println(“disconnecting.”);
client.stop();
for(;:wink:
;
}
}

sometimes I can get response from the website. Sometimes connection fails. I cannot figure out what causes that. Any help would be appreciated.

My code works perfectly when i try to access google.com, I suppose the server I use causes that.

Is your server a virtual host? If so, you must include the intended web site as part of the HTTP request header.