Problem whit ethernet shield

Hello

I have a problem whit the ethernet shield, i can´t not read a simple php page there print a number from a webserver.

my code is

#include

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 0, 100 };
byte server[] = { 192, 168, 0, 8 }; // Google

Client client(server, 80);

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

void loop(){
// connect to server
Serial.println("Try to connect to server:");
if (client.connect()){
Serial.println("OK");
} else {
Serial.println("Fail");
}
if (client.connected()){
client.println("GET /status.php");
char c = client.read();
Serial.print(c);
for(;:wink:
;
} else {
Serial.println("Connection problem/discconncted.");
}
client.stop();
Serial.println("Client stopped.");
delay(10000);
}

The log from the serial connection

Try to connect to server: OK ÿ 0 i hope someone can help me whit my problem.

Best regards
Lasse

if (client.connected()){
client.println("GET /status.php");
char c = client.read();
Serial.print(c);
for(;; )
;
} else {

two problems in this section of code:

  1. you do a client.read() without checking to see if anything is actually available for read with client.available().

  2. after that read, you go into an infinite loop that stops all other execution forever.

there could be other problems, but these two jumped out at me.

-j