php - retrieve input type file value using get method -


this question has answer here:

i m trying update images using method

user_form.php

<form action='upload.php' method='get'>     <input type='file' name='user_img' />   <input type='text' name='username' />   <input type='submit' name='update' value='update'> </form> 

upload.php

if(isset($_get['update'])) {   echo 'username: '.$_get['username'];   echo 'file name: '.$_files['user_img']['tmp_name']; } 

i m getting correct value username, however, blank value filename.

can please let me know if can use $_files variable method? if yes please point out m going wrong in above sample code. thank you.

you cannot upload files using http request. files sent in http body, requires post or put request.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -