🕸💡📝Fergus Duniho wrote on Sat, Nov 9, 2019 04:18 PM UTC:
It was preserving the value of $pastmoves after prepending it to the value of $moves, which caused it to be prepended again with a double move. To fix this, I set both $pastmoves and $_POST["pastmoves"] to the empty string after prepending its value to $moves. I had to set the latter to it, because I was using a function called copyformdata(), which recreates the form data from the previous form.
It was preserving the value of $pastmoves after prepending it to the value of $moves, which caused it to be prepended again with a double move. To fix this, I set both $pastmoves and $_POST["pastmoves"] to the empty string after prepending its value to $moves. I had to set the latter to it, because I was using a function called copyformdata(), which recreates the form data from the previous form.