Variables not saving I'm trying to write web server code. However, I am having trouble with part of it.

Currently, to get it to save a bool variable I have it use a pin, as when I ran the code without it, after the page refreshes it resets the variable to its original value.

How do I get it to save the variable in this code without it using the pin?

digitalWrite (equalPin, server.arg("equal").toInt());
char equalText[80];
if(equalState) {
  strcpy(equalText, "priority is equal. &lt;a href=\"/?equal=0\"&gt;Deactivate&lt;/a&gt;");
  equalState = false;
} else {
  strcpy(equalText, "priority is not equal. &lt;a href=\"/?equal=1\"&gt;Activate&lt;/a&gt;");
  equalState = true;
}
equalState = digitalRead(equalPin);


I also have several over copies of this for different pages but if I change 1 of them they all change and reset after 10 seconds.

The code follows the example on this site.
same code snippet without using pin

char equalText[80];

if (equalState){
  strcpy(equalText, "priority is equal. &lt;a href=\"/?equal=0\"&gt;Deactivate&lt;/a&gt;");
  equalState = false;
}
else {
  strcpy(equalText, "priority is not equal. &lt;a href=\"/?equal=1\"&gt;Activate&lt;/a&gt;");
  equalState = true;
}
equalState = server.arg("equal").toInt();


but it does not make much sense to set the value if you already switched the state based on it's previous value