Problem with my internet code

          client.println("<a href=\"/?on\"\">ON</a>");
          client.println("<a href=\"/?off\"\">OFF</a>");

What is the actual HTML source displayed by the browser? You seem to be printing too many quote characters, so it may not be what you expect.

You have debug statements in the code commented out. Why don't you uncomment them so that you can see what HTTP request you're receiving for the 'off' command, and whether the lights are being turned on by the same request or a different request.