Page 1 of 1
ENCTYPE="multipart/form-data" problem
Posted: Thu Feb 05, 2004 2:50 pm
by djot
when i send a form with
<form method="post" action="" ENCTYPE="multipart/form-data">
php 4.2.0 returns exactly nothing (no entered data). The same form without ENCTYPE="multipart/form-data" is send successfully with all data included. For sure, uploads that are inside my form also don't work anymore
any suggestions?
Posted: Thu Feb 05, 2004 5:43 pm
by Pointybeard
I take it your trying to send file information? Just remember that $_POST has your textboxes, options, select etc. $_FILES has your file information of the files you would have specified in file fields. Just try print_r($_POST) and print_r($_FILES) and see what your getting. Hope that helps.
no, nothing is sent
Posted: Thu Feb 05, 2004 6:05 pm
by djot
The problem is that nothing is sent. All like $_GET, $_POST, $_SERVER, $_REQUEST even $QUERY_STRING, $HTTP_POST_VARS and all others I found are empty, when enctype is inside the opening form-tag.
If i remove the enctype only, the form works normally, sends all data (except the uploads for sure).
My main problem is that it doesn't even sent the normal input data with enctype in form tag.
Seems like the form is closed for some reason before the first data could be entered. As I said, I don't get anything, no GET and no POST data only due to that enctype statement. I have the same running fine local on one and online on two servers not running that old php 4.2.0. But that server with 4.2.0 can't handle the enctype it seems. Even a form with just one <input type=text> stays emtpy when enctpye is inserted.
djot
Posted: Thu Feb 05, 2004 6:46 pm
by DuFF
is "action" optional? You may want to put something there, even if you want the page to go to itself. For example:
Code: Select all
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">
Posted: Thu Feb 05, 2004 7:19 pm
by djot
the action statement is not the problem. If you leave action emtpy like action="" the form returns to where i is called from (same for not even inluding action="")
And for sure I did test that with action="" and action"form.php" and action="form.php?parameters" already.
The problem still is that i get no returns from the form with enctype inside. without enctype insdie everything is fine.