falsch verstanden.Sorry for English but I don't speak German.
dori spricht kein wort Deutsch, aber ich! ich bin eine collegin habe aber keine technische kenntnisse und kann so nicht uebersetzen.philipp.fister hat geschrieben: Lustig ist auch die auf einmal vorhandenen Deutsch Kenntnisse
Code: Alles auswählen
......
<p> </p><BR><BR>
<form name="form1" method="post" action="index.htm">´
<input type="text" name="OUT" style="display:none" value="index.htm">
<p align="left"> </p>
<p align="left">
<input type="checkbox" name="OUT" value="A" %PORTA0>
<span class="Stil2"> OUT 1</span></p>
<p align="left">
.........
Code: Alles auswählen
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title></title>
<script language=JavaScript>
function chkFormular()
{
// hier können die Werte auf güligkeit geprüft werden
//
// alert( "help!!!")
// return false;
return true;
}
</script>
</head>
<body>
<style type="text/css">
<!--
BODY { margin: 0 0 0 0; background-color: #90B0D0; text-align:center; }
P, DIV, H1, H2 {font-family: verdana, arial; font-size: 11px;}
H1 { background-color: #CCCCFF; padding-top:5px; padding-bottom:5px;
font-size: 20px; color: #004060; font-weight:bold; letter-spacing: 8px;
border-top: 2px solid #EEEEEE; border-left: 2px solid #EEEEEE;
border-bottom: 2px solid #004060; border-right: 2px solid #004060;}
H2 { font-size: 15px; padding-top: 20px; padding-left:50px; padding-right:50px;
color:#004080; font-weight:bold; text-decoration:underline;
border-top: 1px solid #004080;} P, H1, H2 {margin: 0px 0px 5px 0px;}
-->
</style></head>
</style></head>
<blockquote>
<blockquote>
<blockquote>
<body><div align="center">
<h1>Setup %DATE %TIME </h1>
<div align="left">
<form name="Formular" action="setup.htm" method="post" onsubmit="return chkFormular()">
<input type="text" name="OUT" style="display:none" value="setup.htm">
<pre>
Temp1 <input type="text" size="4" name="OUT" value="%adc4"> Licht <input type="text" size="4" name="OUT" value="%adc5"> Temp2 <input type="text" size="4" name="OUT" value="%adc6"> Temp3 <input type="text" size="4" name="OUT" value="%adc7">
<BR>
<input type="submit" name="SUB" value="Setzen">
</pre>
</form>
<p> </p><BR><BR>
<BR><BR> <p align="left"> <h2></h2><BR>
<p><a href="index.htm">Hauptseite</a></p><BR>
<BR><BR><p align="left"> <h2></h2><BR>
</body>
</html>
Code: Alles auswählen
//Einzelne Postpacket (z.B. bei firefox)
if(http_entry[index].http_auth && http_entry[index].post == 1)
{
quellfile[0] = 0;
for(input = 0, a = TCP_DATA_START_VAR;a<(TCP_DATA_END_VAR);a++ )
{
//Schaltanweisung finden!
if (eth_buffer[a] != *http_entry[index].post_ptr++)
{
http_entry[index].post_ptr = post_in;
}
if(*http_entry[index].post_ptr == 0)
{
// HTML-Seitenname lesen !! Dieser ist in der HTML
eth_buffer[a+1+strcspn( (char*)(ð_buffer[a+1]), "&" )] = 0;
// usart_write( "input%i = %s\r\n", input, (char*)(ð_buffer[a+1]));
if( !input ) strcpy( quellfile, (char*)(ð_buffer[a+1]) );
if( !strcmp( quellfile, "index.htm" ) )
{
switch (eth_buffer[a+1])
{
case ('A'):
PORT_tmp = PORT_tmp + 1;
break;
//case (B) und so weiter
Code: Alles auswählen
http_entry[index].post_ptr = post_in;
//Schaltanweisung wurde gefunden
} //if( !strcmp( quellfile, "index.htm" ) )
//**********************************************************************
if( !strcmp( quellfile, "setup.htm" ) )
{
switch( input )
{
case 1:
adc4 = atoi( (char*)ð_buffer[a+1] );
break;
case 2:
lcd_print(3,12, "ADC5:%s", (char*)ð_buffer[a+1]); //Testausgabe auf LCD
adc5 = atoi( (char*)ð_buffer[a+1] );
break;
case 3:
adc6 = atoi( (char*)ð_buffer[a+1] );
break;
case 4:
adc7 = atoi( (char*)ð_buffer[a+1] );
break;
}
http_entry[index].post_ptr = post_in;
} //if( !strcmp( quellfile, "setup.htm" ) )
input++;
//**********************************************************************
} // if(*http_entry[index].post_ptr == 0)
// ab hier gest auch wieder "normal" weiter :)
Code: Alles auswählen
if (strncasecmp_P(token,PSTR("VA@"),3)==0)
{
//HTTP_DEBUG(" - Analogwert");
b = (token[3]-48)*10; //zehner stelle (VA08)
b +=(token[4]-48); //einer stelle
itoa (var_array[b],var_conversion_buffer,10);
str_len = strnlen(var_conversion_buffer,CONVERSION_BUFFER_LEN);
memmove(ð_buffer[TCP_DATA_START+a],var_conversion_buffer,str_len);
a += str_len-1;
nchars = 5;
}
//*****************************************************
//AD
if (strncasecmp_P(token,PSTR("adc4"),4)==0)
{
sprintf_P(var_conversion_buffer,PSTR("%i"), adc4);
str_len = strnlen(var_conversion_buffer,CONVERSION_BUFFER_LEN);
memmove(ð_buffer[TCP_DATA_START+a],var_conversion_buffer,str_len);
a += str_len-1;
nchars = 4;
}
if (strncasecmp_P(token,PSTR("adc5"),4)==0)
{
sprintf_P(var_conversion_buffer,PSTR("%i"), adc5);
str_len = strnlen(var_conversion_buffer,CONVERSION_BUFFER_LEN);
memmove(ð_buffer[TCP_DATA_START+a],var_conversion_buffer,str_len);
a += str_len-1;
nchars = 4;
}
if (strncasecmp_P(token,PSTR("adc6"),4)==0)
{
sprintf_P(var_conversion_buffer,PSTR("%i"), adc6);
str_len = strnlen(var_conversion_buffer,CONVERSION_BUFFER_LEN);
memmove(ð_buffer[TCP_DATA_START+a],var_conversion_buffer,str_len);
a += str_len-1;
nchars = 4;
}
if (strncasecmp_P(token,PSTR("adc7"),4)==0)
{
sprintf_P(var_conversion_buffer,PSTR("%i"), adc7);
str_len = strnlen(var_conversion_buffer,CONVERSION_BUFFER_LEN);
memmove(ð_buffer[TCP_DATA_START+a],var_conversion_buffer,str_len);
a += str_len-1;
nchars = 4;
}
//*****************************************************
Code: Alles auswählen
if(http_entry[index].http_auth && http_entry[index].post == 1)
{
//nun die LCD Inhalte finden
//IMES=....&
char* nPos=strstr_P((char*)ð_buffer[TCP_DATA_START], PSTR("IMES="));
strlcpy(internal_message, nPos+5,100); //SUBBUG: nur 100 von 255 möglichen
for(int i=0;i<strlen(internal_message);i++)
{
if(internal_message[i]=='&')
{
internal_message[i]=0x00;
break;
}
}
urldecode(internal_message);
for(a = TCP_DATA_START_VAR;a<(TCP_DATA_END_VAR);a++)
{
HTTP_DEBUG("%c",eth_buffer[a]);
//Schaltanweisung finden!
if (eth_buffer[a] != *http_entry[index].post_ptr++)
{
//HTTP_DEBUG("%c", *http_entry[index].post_ptr);
http_entry[index].post_ptr = post_in;
}
if(*http_entry[index].post_ptr == 0)
{
switch (eth_buffer[a+1])
{
case ('A'):
PORT_tmp = PORT_tmp + 1;
break;
case ('B'):
PORT_tmp = PORT_tmp + 2;
break;
case ('C'):
PORT_tmp = PORT_tmp + 4;
break;
#if USE_WOL
case 'W':
wol_enable = 1;
break;
#endif //USE_WOL
}
http_entry[index].post_ptr = post_in;
//Schaltanweisung wurde gefunden
}
//Submit schließt die suche ab!
if (eth_buffer[a] != *http_entry[index].post_ready_ptr++)
{
http_entry[index].post_ready_ptr = post_ready;
}
if(*http_entry[index].post_ready_ptr == 0)
{
http_entry[index].post = 0;
PORTC = PORT_tmp;
PORT_tmp = 0;
break;
//Submit gefunden
}
}
}
Code: Alles auswählen
if (strncasecmp_P("VA@",http_entry[index].new_page_pointer,3)==0)
{
b = (pgm_read_byte(http_entry[index].new_page_pointer+3)-48)*10;
b +=(pgm_read_byte(http_entry[index].new_page_pointer+4)-48);
itoa (var_array[b],var_conversion_buffer,10);
str_len = strnlen(var_conversion_buffer,CONVERSION_BUFFER_LEN);
memmove(ð_buffer[TCP_DATA_START+a],var_conversion_buffer,str_len);
a = a + (str_len-1);
http_entry[index].new_page_pointer=http_entry[index].new_page_pointer+5;
}
if (strncasecmp_P("VM@", http_entry[index].new_page_pointer,3)==0)
{
b = (pgm_read_byte(http_entry[index].new_page_pointer+3));
if(b=='I')
{//internal Message
str_len=strnlen(internal_message, 255);
memmove(ð_buffer[TCP_DATA_START+a], internal_message, str_len);
a = a + (str_len-1);
http_entry[index].new_page_pointer=http_entry[index].new_page_pointer+4;
}
}
Code: Alles auswählen
void urldecode(char *urlbuf)
{
char c;
char *dst;
dst=urlbuf;
while ((c = *urlbuf)) {
if (c == '+') c = ' ';
if (c == '%') {
urlbuf++;
c = *urlbuf;
urlbuf++;
c = (h2int(c) << 4) | h2int(*urlbuf);
}
*dst = c;
dst++;
urlbuf++;
}
*dst = '\0';
}