> Well, I did as you suggested but the page is popping up onload not onunload.--------forget it. this code is working fine. I was refreshing the page, what was calling the unload function. > > <BODY onunload="apaga();"> > <script language="javascript"> > function apaga(){ > window.open(compressao2.php?diretorio=d14,"compressao2","toolbar=no");} > </script> > > > ----- Original Message ----- > From: Rich Cavanaugh <[EMAIL PROTECTED]> > To: Eduardo Kokubo <[EMAIL PROTECTED]>; Chris Cocuzzo > <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, August 07, 2001 2:52 PM > Subject: RE: [PHP] something wrong > > > > Ok, this is just a variant of a question asked almost daily. You are > trying > > to call a PHP function using JavaScript. PHP is handled on the server, > > JavaScript is done client side. The browser doesn't know anything about > PHP. > > Another option might be to use the onunload handler to popup (might piss > off > > people though) a window which would load that PHP script and delete the > > file. > > > > rich > > > > > > > > -----Original Message----- > > From: Eduardo Kokubo [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, August 07, 2001 1:49 PM > > To: Chris Cocuzzo > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] something wrong > > > > > > I tried it using return and without it, but unfortunly neither cases > > worked. > > > > ----- Original Message ----- > > From: Chris Cocuzzo <[EMAIL PROTECTED]> > > To: Eduardo Kokubo <[EMAIL PROTECTED]> > > Sent: Tuesday, August 07, 2001 2:21 PM > > Subject: Re: [PHP] something worong > > > > > > > hey- > > > > > > I'm not sure, but maybe try this: > > > > > > body onunload="<?php return apaga($diretorio);?>" > > > > > > for some reason i don't think that'd work, prolly because of the quotes > > > around the php, however i think you need to call it that way. But can > you > > > ever use return that way?? > > > > > > chris > > > > > > > > > ----- Original Message ----- > > > From: Eduardo Kokubo <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Cc: <[EMAIL PROTECTED]> > > > Sent: Tuesday, August 07, 2001 1:12 PM > > > Subject: [PHP] something worong > > > > > > > > > Hi, > > > > > > I'm using this code to delete a file using onunload, but this is not > > > working. Can anyone please tell me why? I know the function apaga() > works, > > > but the onunload thing doesn't. I probably missed a detail. > > > > > > <html> > > > <head> > > > </head> > > > <BODY onunload="return apaga($diretorio);"> > > > <?php > > > > > > function apaga($diretorio){ > > > > > > unlink ("$diretorio.tgz"); > > > > > > } > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]