Page 1 of 1
Odd behavior in form enctype="multipart/form-data"
Posted: Thu Jun 26, 2003 10:30 pm
by qartis
I've been editing phpBB2 (2.0.4), specifically profile.php, to include one of those "type the string you see in the image into a textbox" human-verification thingies into phpbb's registration script. Now, they've obfuscated the code quite a bit, created 3 files instead of 1, and also they've gotten the registration and profile viewing/editing all done with the same function set. So, I managed to craftily incorporate my little functions into the form, but all of a sudden, the profile.php?mode=register form, which starts with
Code: Select all
<form action="profile.php" enctype="multipart/form-data" method="post">
Refuses to pass GET or POST variables. Completely. I tried everything I could think of, and I finally found out that the
enctype="multipart/form-data" is the culprit. Thing is, that line is necessary to allow avatar uploads, et cetera. Server is Apache 1.3.27, PHP 4.1.2, RedHat 7.3, no unusual extensions loaded. Am I doing something really dumb here, or what?
Posted: Fri Jun 27, 2003 2:20 am
by volka
not really answering your question (I really don't know by now ):
what did you do to profile.php?

why not in includes/usercp_register.php?
Posted: Fri Jun 27, 2003 2:49 am
by qartis
Oh, I didn't put the bulk of the new stuff into profile.php, but all registrations won't work now, and I found out it's because the action of the main registration form is to profile.php, with the post variable "mode" set to "register", but if I change profile.php to
It doesn't receive any of them, but if I take out the form's enctype, it works beautifully.
Posted: Fri Jun 27, 2003 3:08 am
by volka
without your changes does it work with enctype="multipart/form-data" ?
Posted: Sat Jun 28, 2003 3:55 am
by qartis
No, which is puzzling. Even on a brand spanking new phpbb, it won't pass any more data via multipart forms. Meh, I disabled avatar uploads to the board, removed the enctype of the form, and the new code works beautifully.
But, granted "good enough" isn't good enough, why do POST (and GET, now) variables get mangled in a multipart form? They shouldn't, so what portion of the server would malfunction and be *able* to do that? Apache, or PHP; it's not the browser.
Maybe it's time for a recompile.