I seem to recall reading it's a name reserved by PHP
It's not reserved in PHP, it's reserved by the DOM. This problem originates from the document, not in PHP. A short prequel,
<input type="submit" name="submit" value="Submit">
Naming or ID'ing an item
submit,
reset, - and here's a surprise one I spent hours figuring out -
search (as in the original topic's example), can create some serious head-scratching problems as to why something is not working in Javascript, or why some variables that should be posting are not posting.
Second, submit and search are both
functions in Javascript:
document.forms[0].submit()
So if you use [some-form].submit() somewhere in the scope of your current javascript, executing 'document.getElementById('submit')' will give you "object doesn't support this property or method." Because the submit() function doesn't have an id to get. :-)
Although you can sometimes get lucky and create conditions where you've id'ed or named something as "submit" and it works, you're just that, lucky, and its a very bad habit to get into.
You use document
ID's to manipulate the document DOM/display via client side scripting and CSS.
ID's are not posted on submit.
Names are posted on submit.
Returning to the original problem: I press search with an "id", the data is looked up in the DB and sent to various input boxes and text areas, though when i try to update a record i lose the value of the id and can't find it anywhere!
So something like
<input type="text" name="myid" id="mid">
$_POST['mid'] is of course not set. $_POST['myid'] should hold the value.