Go Down

Topic: Running php script located on shared web server using ethernet shield (Read 1 time) previous topic - next topic

Question about using shared web servers for running php scripts and ethernet shield

Hello,
I purchased web space on shared server. when i do find ip address of my domain name using dig, it gives me some value like 208.91.199.22. When I type the same ip address on internet browser, it displays a standard page saying this address is that off a shared web server. Hence it cannot identify the domainname associated with it. So now question is; for programming ethernet shield can i give directly domain name like laxmicompanies.com ? or how do i circumvent this issue ?

Regards
MRunal

SurferTim

You must send the "Host:" parameter to a virtual host server.
Code: [Select]
If(client.connect(serverIP,serverPort)) {
   // send request
   client.println("GET /mypage.php HTTP/1.1");
   client.println("Host: www.laxmicompanies.com");
   client.println("Connection: close\r\n");

   // read response
   while(client.connected()) {
      while(client.available()) {
         Serial.write(client.read());
      }
   }
   client.stop();
}


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy