I found that this does not solve the problem stated on this blog. IE6 will still submit multiple name/value pairs even if the name is of the form #name|value.
This is by far the most elegent solution imo. It doeasnt rely on client-side functionality, is invisible to the user and still provides valid xhtml to boot.
If i could be so bold as to provide a slightly leaner alternative:
foreach ($_POST as $key => $val)
if(substr($key,0,1) == "#"){
$bits = explode("|",(substr($key,1)));
unset($_POST[$key]);
$_POST[$bits[0]] = $bits[1];
}
Us oldies hate typing ;)
Comment
I found that this does not solve the problem stated on this blog. IE6 will still submit multiple name/value pairs even if the name is of the form #name|value.
Parent comment
This is by far the most elegent solution imo. It doeasnt rely on client-side functionality, is invisible to the user and still provides valid xhtml to boot. If i could be so bold as to provide a slightly leaner alternative: foreach ($_POST as $key => $val) if(substr($key,0,1) == "#"){ $bits = explode("|",(substr($key,1))); unset($_POST[$key]); $_POST[$bits[0]] = $bits[1]; } Us oldies hate typing ;)