Re: something wrong

From: Date: Tue, 07 Aug 2001 18:56:17 +0000
Subject: Re: something wrong
Groups: php.general 
Request: Send a blank email to php-general+get-61678@lists.php.net to get a copy of this message
> 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 <rcavanaugh@advolve.com> > To: Eduardo Kokubo <kokubo@inf.univali.br>; Chris Cocuzzo > <cuzo@mediaone.net> > Cc: <php-general@lists.php.net> > 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:kokubo@inf.univali.br] > > Sent: Tuesday, August 07, 2001 1:49 PM > > To: Chris Cocuzzo > > Cc: php-general@lists.php.net > > Subject: Re: [PHP] something wrong > > > > > > I tried it using return and without it, but unfortunly neither cases > > worked. > > > > ----- Original Message ----- > > From: Chris Cocuzzo <cuzo@mediaone.net> > > To: Eduardo Kokubo <kokubo@inf.univali.br> > > 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 <kokubo@inf.univali.br> > > > To: <php-general@lists.php.net> > > > Cc: <kokubo@inf.univali.br> > > > 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: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#61678) next »