• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

going nutts with php file upload

zimu

Diamond Member
i'm ripping my hair out.

basically i have a form,
<form method="post" action="index.php" enctype="multipart/form-data">

one of the inputs:
<input type=file name=filename>


then, in the form processing:
if (isset($HTTP_POST_VARS['submit']) &amp;&amp; ($_FILES['filename']['tmp_name'])) {
(code to upload).


now this form works perfectly fine on another page of mine, but i must be overlooking something. i've tried var dumping $_files, it returns null. the isset-submit returns true for sure, i've put that by itself and it registers. but $_files-filename returns false, even thouhg i just submitted a damn file!!

help?
 
doesnt' make a diff to the code, they function the same. but the problem isn't in the HTTP_POST_VARS, its in the $_FILES['filename'][] part of it...
 
Originally posted by: zimu

if (isset($HTTP_POST_VARS['submit']) &amp;&amp; ($_FILES['filename']['tmp_name'])) {

help?

Shouldn't it be:


if (isset($HTTP_POST_VARS['submit']) &amp;&amp; isset($_FILES['filename']['tmp_name'])) {

?

Also, not trying to offend you, but make absolutely sure that the file input is within the < form > < / form >
tags.
 
Originally posted by: RSMemphis
Originally posted by: zimu

if (isset($HTTP_POST_VARS['submit']) &amp;&amp; ($_FILES['filename']['tmp_name'])) {

help?

Shouldn't it be:


if (isset($HTTP_POST_VARS['submit']) &amp;&amp; isset($_FILES['filename']['tmp_name'])) {

?

Also, not trying to offend you, but make absolutely sure that the file input is within the < form > < / form >
tags.

the addition of the isset makes no difference, added it.
and the file input is defintely within the form tags (no offense taken 🙂
 
Back
Top