i create web service with PHP and i have the following problem ; 1. I create upload form, but $_FILES['file1']['name']; did't work. note :i can get $file, but when i try to get file name it didn't work. 2. I create login form, and session didn't work too.
OK i am guessing you are trying to upload a file and store it in a directory. If this is the case, try this for an example: copy($_FILES['file1']['tmp_name'],"subdir/".$_FILES['file1']['name']); The $_FILES array contains only information about the uploaded file, not the actual file itself. tmp_name contains the location of the uploaded file, and this is why you copy it from tmp_name to where you want it stored. In the case of images you can even run imagejpeg or imagecreatefromjpeg with the value of tmp_name. 2. For sessions make sure you have called session_start(); at the beginning of the script (There can be NO OUTPUT prior to session_start(); or you will get a headers error). Hope this helps, if not you will need to be more specific about the problems you are getting. Possibly some example code would help too.
1. That's not the problem if is store $_FILES['file1']['name'] in $filea $filea=$_FILES['file1']['name'] and and echo "$filea", it will no result, so that's why i say that $_FILES['file1']['name'] didn't work. 2. i has already do that but not working. Note : All working without web service, but when i convert it to web service upload file and login didn't work.
Is : 1. The form "enctype" multipart/form-data? Otherwise it won't upload 2. Does the file input field have the name "file1"?