Go Down

Topic: Ethernet Shield with index.htm SDcard. (Read 11749 times) previous topic - next topic

Thank you for your attention but I will not answer anymore, because did not understand my last post, and use the google translator did not help.

Forget the part of the SD, just want to know why when I type ip: 6969 on another computer it does not appear to me that:

http://imageshack.us/photo/my-images/525/controlcz.jpg/
http://imageshack.us/photo/my-images/525/controlcz.jpg/


but this:

http://imageshack.us/photo/my-images/29/principals.jpg/


I'm not mad at you, I'm just frustrated because he could not make them understand

SurferTim

You don't have to answer. If you manage to get by the hardware problem, then I would suspect this comparison:
Code: [Select]
        if(readString.trim() == ("GET /?C=1678 HTTP/1.1")){
          //client.println("<h1>Clave Ok</h1>");
          Portada();
       }else{
          //client.println("<h1>Clave Erronea</h1>");
       }     


Just talking out loud here. I would try this instead. But that is just me.
Code: [Select]
        if(strcmp(readString.trim(), "GET /?C=1678 HTTP/1.1") == 0) {
          //client.println("<h1>Clave Ok</h1>");
          Portada();
       }else{
          //client.println("<h1>Clave Erronea</h1>");
       }     


#17
Apr 15, 2012, 05:53 pm Last Edit: Apr 15, 2012, 05:55 pm by rodolfovieira Reason: 1

You don't have to answer. If you manage to get by the hardware problem, then I would suspect this comparison:
Code: [Select]
       if(readString.trim() == ("GET /?C=1678 HTTP/1.1")){
         //client.println("<h1>Clave Ok</h1>");
         Portada();
      }else{
         //client.println("<h1>Clave Erronea</h1>");
      }    


Just talking out loud here. I would try this instead. But that is just me.
Code: [Select]
       if(strcmp(readString.trim(), "GET /?C=1678 HTTP/1.1") == 0) {
         //client.println("<h1>Clave Ok</h1>");
         Portada();
      }else{
         //client.println("<h1>Clave Erronea</h1>");
      }    






i try this but gives errores


Code: [Select]
if(strcmp(readString.trim(), "GET /?C=1678 HTTP/1.1") == 0) {
         //client.println("<h1>Clave Ok</h1>");
         Portada();
      }else{
         //client.println("<h1>Clave Erronea</h1>");
      }    


look:

http://www.freeimagehosting.net/qap5b

SurferTim

#18
Apr 15, 2012, 06:08 pm Last Edit: Apr 15, 2012, 06:14 pm by SurferTim Reason: 1
Now we are going places!

I don't use String types, and this (among other reasons) is why. I use character arrays.
Code: [Select]
char readString[20];


If you pass readString as a parameter now, it will work. At least it should. I have not used the .trim() function before, but now I might try it.

You will probably need to redo your ad-a-character routine to that array. Like this:
Code: [Select]
int charCount;
char readString[20];

// Then in the loop
charCount = 0;
readString[0] = 0;

while(client.available())
{
  char c = client.read();

  if(charCount < 19)
  {
     // store character
     readString[charCount] = c;
     charCount++;
     // set terminating zero
     readString[charCount] = 0;  
  }
}

// If you need to empty the array,
charCount = 0;
readString[0] = 0;


edit: I added the readString zero terminator when I set charCount to zero.

hummmm this is something very difficult for me.

Do all you can send me the sketch already modified?
Or is abusing your generosity?

I do not know programming, these codes have been taking and adapting.

Thanks again

SurferTim

Take a look here. Reply #3 has a web server with two form fields.
http://arduino.cc/forum/index.php/topic,94861.0.html

Bear in mind that sketch is IDE v1.0 and better to compile.

Go Up