Jump to content

php form submittion problem with file and textarea


Zerpex

Recommended Posts

Hia,

 

I'm having a form, containing an image upload, a textarea and some other fields.

 

I have a fileupload, where I check if the upload thingy is empty, with

if(empty($_POST['image']))
{
    echo "Error";
}
else
{
    //Do the imageUpload here
}

 

using the empty, isn't working for some reason, it proceed to the else anyway.

 

Also, I have a textarea with name="productDesc", when I do:

<?php
var_dump($_POST);
?>

 

It doesn't return the textarea, and I can't see why it doesn't.

Also the textarea proceed to the 'else' in the if else in the following code:

 

http://codepad.org/wMd6SnoK

 

Having a lot of questions these days  ::)

 

Thank you guys!

Link to comment
Share on other sites

In my head

 

if(empty($brandid) && empty($_FILES['image']) && empty($_POST['productDesc']))

 

should be true, if just one of them is empty (which the image and textarea) is at the moment, but it still returns false, so it proceed to the actual imageupload :/ it should do the error :(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.