Home > Archive > PHP Programming > June 2005 > fermeture de fenetre
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
fermeture de fenetre
|
|
| Thomas Raso 2005-06-09, 8:56 am |
| bonjour,
dans mon apllication, j'ai mis en place un bouton "quitter l'appli" qui vide
les variables de session et exéecute une dernière requete sur la BD (tout
ceci en php)
mais en meme temps je voudrais que la fenetre du navigateur se ferme.
.....
if (!empty($old_user))
{
echo 'Vous êtes bien déconnecté.<br />';
?>
<script type="text/javascript" language="javascript">
window.close();
</script>
<?php
}
......
et la console javascript de mon navigateur me renvoi " Les scripts ne
peuvent pas fermer une fenêtre qui n'a pas été ouverte par un script"
le navigateur est un FireFox 1.0.4
Comment faire pour que la fenetre se ferme quand meme ???
Bon moi je suis parti sur du JavaScript mais si on peut le faire avec du php
ou autre chose, je suis ouvert...
Merci
| |
| Alvaro G Vicario 2005-06-09, 8:56 am |
| *** Thomas Raso wrote/escribió (Thu, 9 Jun 2005 08:47:21 +0200):
> <script type="text/javascript" language="javascript">
> window.close();
> </script>
> et la console javascript de mon navigateur me renvoi " Les scripts ne
> peuvent pas fermer une fenêtre qui n'a pas été ouverte par un script"
This is an English-speaking group about PHP and you posted a question about
JavaScript written in French...
Anyway, as your browser warns you cannot close a window you didn't open
before. There's nothing you can do about it and that's good. Why don't you
just print "You have successfully logged out. You can close this window."
and let user decide?
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
| |
|
| > *** Thomas Raso wrote/escribió (Thu, 9 Jun 2005 08:47:21 +0200):
>
>
> This is an English-speaking group about PHP and you posted a question
> about
> JavaScript written in French...
Where does it say that it is an English group?
The fact that 99.9% of users choose to use English does not make it an
English only club.
Furthermore he was asking why it not work and if the same could be done in
php, (or any other language).
>
> Anyway, as your browser warns you cannot close a window you didn't open
> before. There's nothing you can do about it and that's good. Why don't you
> just print "You have successfully logged out. You can close this window."
> and let user decide?
>
Simon
| |
| Geoff Berrow 2005-06-09, 8:56 pm |
| I noticed that Message-ID: <3grj8kFdukllU1@individual.net> from simon
contained the following:
>
>Where does it say that it is an English group?
>The fact that 99.9% of users choose to use English does not make it an
>English only club.
It is an International group but it is English speaking.
There is alt.fr.comp.lang.php and
fr.comp.infosystemes.www.auteurs.php
and probably fr.comp.lang.php
>
>Furthermore he was asking why it not work and if the same could be done in
>php, (or any other language).
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
| |
| News KF 2005-06-10, 8:55 am |
| Hi,
I guess, there is no other way to close the window (as Simon said already)
However if you really want to close the window, then you have probably
to make sure, that the window has been opened by a java script.
Another solution could be, (but that's more a java script question) to
have a signed java
script. Perhaps this one could close the window even if it were not
opened by a script, but please don't ask me how to sign a java script.
I do not know :-(
bye
Kf
Alvaro G Vicario wrote:
> *** Thomas Raso wrote/escribió (Thu, 9 Jun 2005 08:47:21 +0200):
>
>
>
>
>
> This is an English-speaking group about PHP and you posted a question about
> JavaScript written in French...
>
> Anyway, as your browser warns you cannot close a window you didn't open
> before. There's nothing you can do about it and that's good. Why don't you
> just print "You have successfully logged out. You can close this window."
> and let user decide?
>
>
>
| |
| Alvaro G Vicario 2005-06-10, 8:55 am |
| *** simon wrote/escribió (Thu, 9 Jun 2005 20:21:20 +0100):
> Where does it say that it is an English group?
History?
France is French speaking country, no matter if some of its inhabitants
cannot speak it ;-)
> Furthermore he was asking why it not work and if the same could be done in
> php, (or any other language).
I can't speak French, I only grasped some meaning from the message from the
fact French is a latin language. The answer to that is no: you cannot close
a window from a remote server. It's JavaScript or nothing.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
|
|
|
|
|