Arduino Wi-fi shield Does not Connect to Server

Hi
I need a help. I am trying to connect to a server via wi-fi shield to upload the temperature and wind speed from Arduino. The connection from wi-fi shield to accesss point works fine. But it won’t connect to the server. I even tried to connect to www.google.com the example from Arduino website and I am still having the same problem. Can someone help please!!!

I am using Arduino Uno

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "RM2021"; //  your network SSID (name) 
char pass[] = "testnet2021";    // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;            // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "http://mayar.abertay.ac.uk";    // name address for Google (using DNS)

// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
WiFiClient client;

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600); 
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  
  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present"); 
    // don't continue:
    while(true);
  } 
  
  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
    status = WiFi.begin(ssid, pass);
  
    // wait 10 seconds for connection:
    delay(10000);
  } 
  Serial.println("Connected to wifi");
  printWifiStatus();
  
  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  if (client.connect(server,80)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    client.println("GET /~1207112/Mpetelo/index.php HTTP/1.1");
    client.println("Host: mayar.abertay.ac.uk");
    //client.println("Connection: close");
    client.println();
    delay (6000);
  }
}

void loop() {
  // if there are incoming bytes available 
  // from the server, read them and print them:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting from server.");
    client.stop();

    // do nothing forevermore:
    while(true);
  }
}


void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}
char server[] = "http://mayar.abertay.ac.uk";    // name address for Google (using DNS)

That is NOT the name of the server. There are no servers anywhere in the world that use "httep://" as part of their name. None.

Hi Paul!!!

Sorry I just happened to post the wrong part of the code. This was my last attempt to solve the problem.
initially that part of code was:

 char server[] = "mayar.abertay.ac.uk";    // name address for Google (using DNS)

But still wasn't working. So I changed to the following one

char server[] = "http://mayar.abertay.ac.uk";    // name address for Google (using DNS)

in hope that perhaps the server was expecting an http connection to establish the communication but either way do not work.
I read in the forum suggesting that there is a bug with wi-fi shield and workaround is to update the firmware. However, I am not so sure if that is really the case.

Mpetelo:
I read in the forum suggesting that there is a bug with wi-fi shield and workaround is to update the firmware. However, I am not so sure if that is really the case.

It is probably the case. Here is a test to determine which firmware version your shield has.
http://forum.arduino.cc/index.php?topic=214435.msg1570248#msg1570248
If you are using IDE v1.0.5 and it shows 1.0.0, then you should upgrade the firmware.