RE: [PHP] something wrong

From: Date: Tue, 07 Aug 2001 17:52:01 +0000
Subject: RE: [PHP] something wrong
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61669@lists.php.net to get a copy of this message
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

« previous php.general (#61669) next »