Hi holstead,
Firstly we must get our code working : <form action="<? $SERVER['PHP_SELF']; ?> is wrong and will break with a "404" error, it should be <form action="<?= $SERVER['PHP_SELF']; ?>" note the " and the "=" after the first "<?"
Getting your code syntacticial correct is very important as other languages are much less forgiving and getting it correct now when you are learning is such an important habit to get into.
Right lets get into your problem, we will use just the form declaration itself and assume the body is always the same (all the stuff between <form.....> and </form>
//All three of these examples has either a different enctype types or none at all, I am using windows XP, IE6
//your form header
<form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" enctype="text/plain">
.....doesn't work on my system at all
//your other form header
<form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
.....this works on my system : output '5'
//my form header
<form action="<?=$_SERVER['PHP_SELF']; ?>" method="POST">
....this works on my system : output '5'
So where does this leave us? well lets check out the php.ini file, on my system its C:\WINDOWS\php.ini
You can open this in notepad and I need you to find this part
; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"
; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On
The above is my php.ini file, what does yours look like? if different to mine try changing it to mine and retest your form headers.
I am sure it is some collision with the default_mimetype that is set in your php.ini file versus the enctype type you are trying to use
Here is a post about a bug that got me thinking about your bug
http://bugs.php.net/bug.php?id=20435
I am suspecting it has to do with your php.ini settings assuming you have explored all the other suggestions in previous posts.
So try setting your php.ini to mine, change your code so it works....re-test it a few different ways and post here what happened
I hope this is helping you in some way and we will get to the bottom of this.
BBK 🙂