3

I just ran in the form action var_dump($_GET), it has given following results when I submitted the form and it is giving form values to the URL.

array (size=4)
'randomkey' => string 'asdf' (length=4)
'agreementid' => string 'adfas' (length=5)
'attachment' => string '' (length=0)
'upload' => string 'Add' (length=3)

But, When I ran the var_dump($_POST) with same form values it has given following results-

array (size=0)
  empty

I have checked several thread of StackOverFlow.com, like-
1. PHP $_POST not working but $_GET works fine
2. https://stackoverflow.com/questions/14573071/
I have checked RadCompression RadUploadModule both are turned off. I have tried by removing .php from form action value, because I have removed .php extension using .htaccess

HTML @ below-

<form action=\"upload\" enctype=\"multipart/form-data\" method=\"post\">
        <input type='text' value='' name='randomkey' />
        <input type='text' value='' name='agreementid' />
        <input type='file' name='attachment' />
        <input type='submit' name='upload' value='Add' />
    </form>

What Can I Do Right Now?

Community
  • 1
  • 1

2 Answers2

0

As viewing the html code you are using POST method, so you will get the result using $_POST not using $_GET.

Alternatively you can also use $_REQUEST for viewing the request coming.

Yogesh Suthar
  • 30,424
  • 18
  • 72
  • 100
  • 3
    His problem is that `$_POST` isn't returning anything. – EM-Creations Jun 11 '13 at 09:40
  • @EM-Creations The same code is working fine in my end with `$_POST`. And I also said him to use alternate way. – Yogesh Suthar Jun 11 '13 at 09:45
  • I solved the problem and successfully inserted data to the table and moved multiple files to the directory. I will post the answer here.. Thanks all of you for giving me some ideas! –  Jun 11 '13 at 13:06
0

use die() or exit() after var_dump() function ... i believe it will work ...

Ala Alam Falaki
  • 345
  • 1
  • 9
  • 19