A logout button, php page
enisione
-
lekobus Posted messages 13 Registration date Status Membre Last intervention -
lekobus Posted messages 13 Registration date Status Membre 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 réponses
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()">
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()">
ghuysmans99
Posted messages
2496
Registration date
Status
Contributeur
Last intervention
340
And no: http://img337.imageshack.us/img337/7491/windowclosefirefox.png
(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 !
--
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');
```
// 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 !
--
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
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