Pages: 1 [2]   Go Down
Author Topic: Ethernet Shield with index.htm SDcard.  (Read 10612 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miramar Beach, Florida
Online Online
Faraday Member
**
Karma: 144
Posts: 5975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to answer. If you manage to get by the hardware problem, then I would suspect this comparison:
Code:
        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:
        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>");
       }     
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to answer. If you manage to get by the hardware problem, then I would suspect this comparison:
Code:
       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:
       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:
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
« Last Edit: April 15, 2012, 10:55:31 am by rodolfovieira » Logged

Miramar Beach, Florida
Online Online
Faraday Member
**
Karma: 144
Posts: 5975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now we are going places!

I don't use String types, and this (among other reasons) is why. I use character arrays.
Code:
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:
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.
« Last Edit: April 15, 2012, 11:14:57 am by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miramar Beach, Florida
Online Online
Faraday Member
**
Karma: 144
Posts: 5975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: 1 [2]   Go Up
Jump to: