A logout button, php page
enisione
-
lekobus Posted messages 13 Registration date Status Member Last intervention -
lekobus Posted messages 13 Registration date Status Member Last intervention -
Hello,
I have a Firefox browser.
I have a web application and I need to create a button that closes the tab.
I want to create a close button with PHP, JavaScript, HTML, or a combination of all three. Its role is to close the tab.
I have a Firefox browser.
I have a web application and I need to create a button that closes the tab.
I want to create a close button with PHP, JavaScript, HTML, or a combination of all three. Its role is to close the tab.
8 answers
-
Good evening,
To close your page, you simply use the window.close() function! You can place this function wherever you want: in a text link, an image link, or, as shown below, a real form button:
<input type="button" value="Close" onClick="window.close()"> -
(Cannot be PHP as it executes on the server side and not entirely HTML since it's for formatting). Not possible: a JS code cannot destroy a window it did not create itself.
--
Google is your best friend
VB.NET is good ... VB6 is better ! -
```javascript
// Pour ouvrir un nouvel onglet avec JavaScript, utilisez la méthode window.open().
window.open('https://www.example.com', '_blank');
``` -
-
There isn't any to my knowledge ...
--
Google is your best friend
VB.NET is good ... VB6 is better ! -
Good evening,
Ghuysmans99 I don't know what you tested because for me with Opera it works very well, it automatically closes the tab when you click on "close". Maybe Mozilla displays it incorrectly.
Anyway, I'll give you the complete code again:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<input type="button" value="Close" onClick="window.close()">
</body>
</html>
PS: Try with several browsers -
As for IE8, no button can close the window without a confirmation request, or a script error, etc.
-
Hi Mastercrow, your code works well with Opera, but it doesn't work with Firefox. How can I make it work with Firefox?
Thank you for your help. a++++++++