简体   繁体   中英

PHP $_POST Undefined index but var_dump works

when I do

var_dump($_POST); 

I have the following result :

'apk' => string 'apk_techs.apk' (length=13)

which is what I'm expecting, but when I do

readFile("./".$_POST['apk']);

it throws the following error

[09-Jun-2017 10:14:00 UTC] PHP Warning:  readfile(./): failed to open stream: No such file or directory in C:\wamp64\www\atawa_api\api_techs.php on line 848

Can someone tell me about somthing I would ignore ?

EDIT

The path is correct and it is only for debugging, the problem isn't that path is incorrect or not found, but not given (considering the undefined index).

for readfile function you have to pass the complete path of file. eg like below : readFile("/var/www/tttt.apk");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM