NEED HELP arduino wifly led controll

Hello evryone i need some help with code i want to make that after i press the button on web page arduno will recevie signal to turn on led which connected to pin 2 wifly connects to wireless network i getting page on with the button but when i press it wifly shield red led indicates that its reciving communication but i cant turn the ligth on

my HTML part of code is

void loop()
{
 
  // Exit command mode if we haven't already
  SPI_Uart_println("exit");
  delay(500);
  Flush_RX();

    while(!Have_Client()); // Wait on client
    Serial.println("\n\rConnection opened.");

    // Send HTML
    HTML_print("<html>");
    HTML_print("<title>Led Control</title>");
    HTML_print("<h1><center>");
    HTML_print("LED CONTROLL");					  
    HTML_print("</center></h1>");
    HTML_print("PUSH THE BUTTON");
    HTML_print("<form type=\"submit\" action=\"\" method=\"post\">");
 //    HTML_print("<input type=\"hidden\" name=\"%\" value=\"1\">");
    HTML_print("<input type=\"submit\" value=\"%\" method=\"post\">");
    HTML_print("</form>");
  HTML_print("<h3>NOTHING HAPPENED LOL :)</h3><p>");
    HTML_print("</html>");
    delay(500);

    // Enter command mode and close connection
    SPI_Uart_print("$$");
    delay(500);
    SPI_Uart_println("close");
    delay(1000);
    SPI_Uart_println("exit");
    delay(500);
    Serial.println("Connection closed.\n\r");
    Flush_RX();
  }

and Parse_Request(void) is

void Parse_Request(void)

{
int val=0, i = 0;
int readval;
  char printflag = 0;
val =  SPI_Uart_ReadByte(RHR);  
	  if((SPI_Uart_ReadByte(LSR) & 0x01))
	   {
	     incoming_data = SPI_Uart_ReadByte(RHR);
	     if(printflag){
	     val = val;
	     i++;
	     }
	     else if (incoming_data == '%'){
	     printflag = 1;
	     }
	     if (printflag = 1 ){
		 digitalWrite(val,LOW); 
		}
		else
		{
		 digitalWrite(val,HIGH);    //??????
		 }
	   }
	    

}

this one supose to send data to arduino

i am using sparkfun tutorial WiFly Wireless Talking SpeakJet Server

and 10 led bar code to control it with c# application

i am just a beginer at programing so need some help with this one

Thank you.

someone please

ok now LED turns on when i connecting to web page but not when i press button on it
still waiting for some help

So far my progress …

Led turns on after i enter page but do nothing when i press the button on it

still hope someone can help me better to understand this so it woud work as is shoud be

void loop()
{
 
  // Exit command mode if we haven't already
  SPI_Uart_println("exit");
  delay(500);
  Flush_RX();

    while(!Have_Client()); // Wait on client
    Serial.println("\n\rConnection opened.");

    // Send HTML
    HTML_print("<html>");
    HTML_print("<title>Led Control</title>");
    HTML_print("<h1><center>");
    HTML_print("LED CONTROLL");                                
    HTML_print("</center></h1>");
    HTML_print("PUSH THE BUTTON");
    HTML_print("<form name=\"%\" action=\"/\" method=\"POST\">");
    HTML_print("<input type=hidden name=\"%\" value=0>");
    HTML_print("<input type=\"submit\" value=\"OFF\">");
 //   HTML_print("<form name=\"%\" action=\"/\" method=\"POST\">");
 //   HTML_print("<input type=hidden name=\"%\" value=\"0\" />");
 // HTML_print("<input type=\"hidden\" name=\"%\" value=\"1\">");
 // HTML_print("<input type=\"submit\" name=\"%\" value=\"0\" />");
    HTML_print("</form>");
    HTML_print("<h3>NOTHING HAPPENED LOL :)</h3><p>");
    HTML_print("</html>");
    delay(500);

    // Enter command mode and close connection
    SPI_Uart_print("$$");
    delay(500);
    SPI_Uart_println("close");
    delay(1000);
    SPI_Uart_println("exit");
    delay(500);
    Serial.println("Connection closed.\n\r");
    Flush_RX();
  }

Parse request void

void Parse_Request(void)
// Parse POST data 
{
int val = 0, i = 0;
int readval;
//  char printflag = 0;
val =  SPI_Uart_ReadByte(RHR);  
        if((SPI_Uart_ReadByte(LSR) & 0x01))
         {
           incoming_data = SPI_Uart_ReadByte(RHR);
 if (incoming_data == '%'){
           val = 1;
           }
           if (val = 1 ){
             digitalWrite(led,HIGH); 
            }
            else
            {
             digitalWrite(led,LOW);    //??????
             }
         }
          

}

have client void

char Have_Client(void)
// Wait until we receive data (client request)
{
  if(SPI_Uart_ReadByte(LSR) & 0x01){ 
    Serial.println("Client request..."); 
//    is_get = 1;
    Parse_Request(); // Check if request is a POST
    Flush_RX();
    return 1; 
  }   
  else{ 
    return 0; 
  } 
}