Here's my function:
function nextname() {
global $modcounter;
global $modID;
return "app" . $modcounter++ . "|" . $modID;
}
and heres the code that calls it. Don't worry about the "echoval()" function. It's not important to my problem.
echo "
<input type='text' name='" . $recwriter = nextname() . "' value='" . echoval("app" . ($modcounter - 1) . "|" . $modID, $modID) . "'>
<input type=hidden name=recwriter value='$recwriter'>";
But the value of the hidden field is always empty, while the name of the text field always has the appropriate value. Shouldn't the value be assigned to the $recwriter variable, and then to my hidden variable as well?