PDA

View Full Version : ajax + php + unlink file



ruicosta
16 Aug 2007, 8:01 AM
Hi,

i've a grid with records, bringed from a mysql db. When i wanto to delete a record, i need to delete 3 files, associated to the record, but, when i try to delete the record, he give me the messae, from de php file:



Data return from the server:
Warning: unlink(../): Permission denied in c:\documents and settings\administrador\ambiente de trabalho\elearning\webadmin\reg_formadores.php on line 153

Warning: unlink(../): Permission denied in c:\documents and settings\administrador\ambiente de trabalho\elearning\webadmin\reg_formadores.php on line 156

Warning: unlink(../): Permission denied in c:\documents and settings\administrador\ambiente de trabalho\elearning\webadmin\reg_formadores.php on line 157


if i tri to make de same operation, without ajax, if function nice, with ajax, give me error.

Any hope for my problem?

regards,

VinylFox
16 Aug 2007, 8:29 AM
PHP cannot tell the difference between AJAX and non-AJAX requests, so you should probably check for other problems in your script, for example, your variables are being passed properly, ie: AJAX is doing a POST but your PHP script is looking for GET data.

steffenk
16 Aug 2007, 8:37 AM
Warning: unlink(../):

there is no file to unlink, search for that!

ruicosta
16 Aug 2007, 8:54 AM
Warning: unlink(../):

there is no file to unlink, search for that!

Thanks, but the file exists. i see the file. the path is correct.

if i call de php writing de url at the address bar, it works, and the file is deleted, but if the call is made by ajax, at the grid the error appears.

steffenk
16 Aug 2007, 9:07 AM
so you have to figure out where the difference is. Does firebug shows the right params?
Make a log entry instead of unlink to see if the file matches.