Can't recieve data from .php (work if .html)

Hi,

I try to receive data from web page with a arduino Uno and a GPRS Shield SIM900.

I upload two test page one in .html and the other in .php. I can read data from the first one but not the second, the AT+HTTPREAD return nothing.
Code PHP

<html>
<body>

<?php
echo "test .php";
?>

</body>
</html>

Code HTML

<a> Test .html </a>

Code Arduino

              Serial.print( "DEBUT requete HTTP" );
              interrupts();
              // SIGNAL QUALITY REPORT
               mySerial.println("AT+CSQ");
               delay(100);
               ShowSerialData();
               
              //Ajout Service GPRS
               mySerial.println("AT+CGATT?");
               delay(100);
               ShowSerialData();
               
               //Paramettre de connection: Connection utilisera le GPRS
               mySerial.println("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");
               delay(1000);
               ShowSerialData();
               
               //Param de connection : APN (Acces Point Name) de l'operateur  (ou ofnew.fr)
               mySerial.println("AT+SAPBR=3,1,\"APN\",\"ofnew.fr\"");
               delay(4000);
               ShowSerialData();
               
               //Ouverture de la connection
               mySerial.println("AT+SAPBR=1,1");
               delay(4000);
               ShowSerialData();
               
              //init du service HTTP
               mySerial.println("AT+HTTPINIT"); 
               delay(2000); 
               ShowSerialData();
               
               // Paramettrage de l'HTTP : URL Du site
               mySerial.println("AT+HTTPPARA=\"URL\",\"www.google.fr\"");
               delay(1000);
               ShowSerialData();
               
               // Envoi de la requete
               mySerial.println("AT+HTTPACTION=0"); 
               
               //Delai important du au possible perturbation reseau
               delay(20000);
               //while(!mySerial.available());
               ShowSerialData();
               
               // Lit la reponse du serveur
               mySerial.println("AT+HTTPREAD");
               delay(300);
               ShowSerialData();
               mySerial.println("");
               delay(100);
               
              //Fermeture de la connection
               mySerial.println("AT+SAPBR=0,3");
               delay(500);
               Serial.print( "FIN requete HTTP" );

Thanks for your help.

A French student

What file names are you using for each? It looks like you are requesting the default home page in your code, not a specific page. Maybe the server doesn't return a php file if you request the home page. Just a thought.

You're going to need to post all of your code to get any substantial help, but it doesn't look as if the fragment you posted makes any attempt to download from anywhere except www.google.fr.

I change the URL but in my source code it’s : www.famillypizza.fr/test.php.

I don’t post all the source code because a much of it have any influence on the HTTP requete.

Can’t post all the source code i get this message “The message exceeds the maximum allowed length (9500 characters).”

I attach it to the topic.

Thanks a lot

TweetPet_source_code.ino (12.9 KB)

MsTimer2.h (436 Bytes)

I'm not up on AT commands, but your server uses virtual hosting. You must send a Host: www.famillypizza.fr with the request or you download this page: http://88.190.204.242 It is larger than than 9500 characters.

If most of your sketch is not relevant to your problem then I suggest you create a minimal test sketch that demonstrates the problem in the simplest possible way, and post that. The act of creating the minimal sketch will help you ensure you understand what is relevant to the problem, and in some cases may even enable you to solve the problem for yourself.