473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

fermeture de fenetre

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

Jul 17 '05 #1
5 1939
*** 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
--
Jul 17 '05 #2
> *** 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...


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
Jul 17 '05 #3
I noticed that Message-ID: <3g************@individual.net> from simon
contained the following:
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.


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/
Jul 17 '05 #4
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):
<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?

Jul 17 '05 #5
*** 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
--
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Caron | last post by:
Hi I try to create a windows service to read content of my database at each 60 minutes. I create my service, i put a timer and set it's interval to 600000. This work good. My problem is that...
1
by: Guillaume Kaddouch | last post by:
Hi, I am in trouble since many days because i'm facing a problem that i can't solve. I used to play with RAW socket under Linux, but the near same code ported on Windows doesn't works, and i...
1
by: Quentin | last post by:
hey there, ok i made a class, that inherits webcontrol, and i add an htmltable to it. I was wondering how to declare an ascx file as an object in my class, like that i could change the content...
0
by: Quentin | last post by:
I made a class in an other file than the aspx one. This class is juste an HtmlTable, it looks like a window, and i'd like to add a property to this class as to add an ascx in a cell. My english is...
0
by: Jean-Marc Boedt | last post by:
hi, I automate office document imaging in a vb.net application in order to obtain the ocr's result on a given tiff file. Everything is ok except that after my subroutine I got a lock on my...
2
by: Bob | last post by:
In a winform with a datagridview using cellvalidating event but also have a save button that is located on a tablebindignnavigator. The behaviour I observe is that if the cellvalidating issues a...
0
by: Ben | last post by:
Hi, I use asp.net 2.0 with Visual web developer. I wrote a page (test.aspx) with the servercontrol "loginview" and another with servercontrol "login". I defined some users. When i start...
0
by: casper | last post by:
Hi, I use asp.net 2.0 and VWD on a windows 2000 server with IIS 5.0. This computer is also the domain controler. The user who uses the aspx page is the domain administrator. The aspx code is...
7
PEB
by: PEB | last post by:
Hi, I've managed to copy an image to the clipboard from other application different from Access, but i want to get the image in the clipboard and save it in tif format using Access... Somewhere...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.