ethernet shield and sensor ultrasonic

Hi to all, i have this problem
i have a shild ethernet and a ultrasoni shild (HC-SR04), and i write this easy scratch (i want use togheter):
the ethernet shild work well, but the ultrasonic shild don’t work, if i use separatly all work well where is the error?
can you hel me?
best regards
A.

#include <SPI.h>
#include <Ethernet.h>
#define trigPin 12
#define echoPin 13

byte mac = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip = { 192, 168, 14, 22 }; // INDIRIZZO IP
byte gateway = { 192, 168, 14, 254 }; // GATWAY

void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin (9600);
Ethernet.begin(mac,ip,dns_server,gateway);
delay(2000);
Serial.println(“connecting…”);
}

void loop() {
String s;
s=misura();
Serial.println(s);
delay(2000);
}

String misura()
{
int duration, distance;
String risultato;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
risultato="cm: ";
risultato.concat(distance);
}

#define trigPin 12
#define echoPin 13

Pins 11, 12, and 13 are the SPI pins. SPI is how the Arduino and the Ethernet shield communicate. You can NOT use pins 12 and 13 for ANY other purpose (if you have a 328-based Arduino).

hi to all, i solved the problem, the ethernet shild use this pin for sd-card PIN 11 - MOSI pin 12 - MISO pin 13 - CLK pin 4 - cs

now i change the pin and now all work well, i hope this help other people ]:)