html page <form action="upload.PHP" enctype="multipart/form-data" method="post"> <input type =file name=kk> <input type=submit> </submit> PHP page upload.PHP <?PHP $file=trim($_FILES['kk']['name']; if(move_uploaded_file($_FILES['kk']['temp_name'],$folder.$file)) { echo"<h1>file uploaded"; } else{echo"<h1>not";} ?> | Sololearn: Learn to code for FREE!

0

html page <form action="upload.PHP" enctype="multipart/form-data" method="post"> <input type =file name=kk> <input type=submit> </submit> PHP page upload.PHP <?PHP $file=trim($_FILES['kk']['name']; if(move_uploaded_file($_FILES['kk']['temp_name'],$folder.$file)) { echo"<h1>file uploaded"; } else{echo"<h1>not";} ?>

can anybody tell be where i'm doing this programme wrong.. it shows an error undefined index:kk in c:\..... on line 6

php

11/14/2016 12:03:09 PM

MANISH KALIA

5 Answers

New Answer

+2

use isset function, this type of error occur when PHP understand that there is already a data. try if(isset($_FILES["kk"]) { //here goes your code } if there is a problem again please comment. I love to help.

+1

I think your html code is wrong. It should be, <input type="file" name="kk"> <input type="submit">

0

php extension...."PHP" change it to "php" :)

0

also input type is not good....what type of input it is.... use (" ") in the name of input

0

thanks alot!!