How to use variables with radiobuttons ?

Hello.
I created 2 radiobuttons:
client.println("
<input type="button" value="ON" onmousedown="location.href ('/?on');"/>");
client.println("<input type="button" value="OFF" onmousedown="location.href ('/?off');"/>");
It works, but i would like to replace the text ON and OFF with a string.
And also the response ('/?on') with an other string.

What is the syntaxe?

Thank you.
Patrick

So why not just change the text from "on" to something else? etc.

...R

Because I want to display a text depending of others conditions in my sketch.
Patrick

It works, but i would like to replace the text ON and OFF with a string.

char clientData[120];
sprintf(clientData, "
<input type=\"button\" value=\"%s\" onmousedown=\"location.href ('/?%s');\"/>", stringOne, stringTwo);
client.println(clientData);

where stringOne = "ON" and stringTwo = "on", or whatever values make your heart go pitter-patter.

Thank you Paul.
But I doesn't work.
My program terminate after the sprintf instruction.
Nothing on the screen.
Is the syntax correct?

Patrick

Hello.
Please find below my syntax.(See my comments)
After the sprintf line command, I have nothing except waiting for http://192.168.0.177

String stringOne="ON1";
String stringTwo="ON2";
char clientData[120];
client.println("test");// The display is OK
sprintf(clientData, "
<input type="button" value="%s" onmousedown="location.href ('/?%s');"/>", stringOne, stringTwo);
client.println(clientData);// No Display
client.println("test");//No display

Please find below my syntax.(See my comments)

It's time you:
a) Quit pissing resources away on the String class.
b) Posted ALL of your code. There is a 99.9% certainty that you program like you have a couple of terrabytes of memory. You don't.

Thanks to follow my problem!!
This is my code: (this is an exemple from the web in which i tried to insert my radio buttons )

//zoomkat 3-17-12
//simple button GET server code to control servo and arduino pin 4
//for use with IDE 1.0
//open serial monitor to see what the arduino receives
//use the \ slash to escape the " in the html
//address will look like http://192.168.1.102:84 when submited
//for use with W5100 based ethernet shields
//Powering a servo from the arduino usually DOES NOT WORK.
//note that the below bug fix may be required
// Google Code Archive - Long-term storage for Google Code Project Hosting.

#include <SPI.h>
#include <Ethernet.h>

#include <Servo.h>
Servo myservo; // create servo object to control a servo

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 0, 177 }; // ip in lan
byte gateway[] = { 192, 168, 0, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(80); //server port

String readString;

//////////////////////

void setup(){

pinMode(12, OUTPUT); //pin selected to control
//start Ethernet
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();

myservo.write(90); //set initial servo position if desired
myservo.attach(7); //the pin for the servo co
//enable serial data print
Serial.begin(9600);
Serial.println("server LED test 1.0"); // so I can keep track of what is loaded
}

void loop(){
// Create a client connection
EthernetClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();

//read char by char HTTP request
if (readString.length() < 100) {

//store characters to string
readString += c;
//Serial.print(c);
}

//if HTTP request has ended
if (c == '\n') {

///////////////
Serial.println(readString); //print to serial monitor for debuging

client.println("HTTP/1.1 200 OK"); //send new page
client.println("Content-Type: text/html");
client.println();

client.println("");
client.println("");
client.println("Arduino GET test page");
client.println("");
client.println("");

client.println("

Simple Arduino button

");

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

String stringOne = "ON1";
String stringTwo = "ON2";

char clientData[120];
client.println("test");

sprintf(clientData, "
<input type="button" value="%s" onmousedown="location.href ('/?%s');"/>", stringOne, stringTwo);
client.println(clientData);

client.println("test2");
client.println("

Simple Arduino button

");

if(readString.indexOf("off357") >0)//checks for on
{
client.println("

Bouton all Off

");
}

delay(1);
//stopping client
client.stop();

///////////////////// control arduino pin
if(readString.indexOf("on") >0)//checks for on
{
myservo.write(40);
digitalWrite(12, HIGH); // set pin 4 high
Serial.println("Led On");
}
if(readString.indexOf("off") >0)//checks for off
{
myservo.write(140);
digitalWrite(12, LOW); // set pin 4 low
Serial.println("Led Off");
}
//clearing string for next read
readString="";

}
}
}
}
}

I fixed my problem!!!

The correct way is:

char* stringOne="ON1";
char* stringTwo="ON2";
char clientData[120];
sprintf(clientData, "
<input type="button" value="%s" onmousedown="location.href ('/?%s');"/>", stringOne, stringTwo);
client.println(clientData);
}

And not: (Else the program crash...)
String stringOne="ON1";
String stringTwo="ON2";
Thanks for your help!