Pages: [1]   Go Down
Author Topic: Running php script located on shared web server using ethernet shield  (Read 1006 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 148
Posts: 6097
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You must send the "Host:" parameter to a virtual host server.
Code:
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();
}
Logged

Pages: [1]   Go Up
Jump to: