By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

PHP quit navigator

P: n/a
i want to create an application web by PHP.
i want to create un command buttum whit must close de navigator
(internet explorer, mosilla, ...)
can you help me

Feb 27 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
so******@gmail.com schrieb:
i want to create an application web by PHP.
i want to create un command buttum whit must close de navigator
(internet explorer, mosilla, ...)
can you help me
PHP is a server-side scripting language, so it can't close the browser
on the client. You are looking for javascript.
I'm not really into this js-thing, but this should work:
OnClick="javascript:window.close()"
Feb 27 '07 #2

P: n/a
so******@gmail.com wrote:
i want to create an application web by PHP.
i want to create un command buttum whit must close de navigator
(internet explorer, mosilla, ...)
can you help me
not possible for security reasons.

bill
Feb 27 '07 #3

P: n/a
Mike Roetgers wrote:
so******@gmail.com schrieb:
>i want to create an application web by PHP.
i want to create un command buttum whit must close de navigator
(internet explorer, mosilla, ...)
can you help me
PHP is a server-side scripting language, so it can't close the browser
on the client. You are looking for javascript.
I'm not really into this js-thing, but this should work:
OnClick="javascript:window.close()"
Good idea, but bad JS. (Well you told us you are not into it. :))

The 'javascript:' thingy is called pseudo protocol, and can be used in
hyperlinks, allthough not advisable because the link will fail in JS
challanged browsers.
When you use an eventhandler (like the onClick) the browser knows it is JS,
so this is enough: OnClick="window.close();"

Regards,
Erwin Moller
Feb 27 '07 #4

P: n/a
so******@gmail.com kirjoitti:
i want to create an application web by PHP.
i want to create un command buttum whit must close de navigator
(internet explorer, mosilla, ...)
can you help me
I think it's safe to assume all browser already have an 'X' button of
some sort that would close the window, or some other means for closing
the browser. Adding another button will only create confusion.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Feb 27 '07 #5

P: n/a
Erwin Moller wrote:
Mike Roetgers wrote:
>so******@gmail.com schrieb:
>>i want to create an application web by PHP.
i want to create un command buttum whit must close de navigator
(internet explorer, mosilla, ...)
can you help me
PHP is a server-side scripting language, so it can't close the browser
on the client. You are looking for javascript.
I'm not really into this js-thing, but this should work:
OnClick="javascript:window.close()"

Good idea, but bad JS. (Well you told us you are not into it. :))

The 'javascript:' thingy is called pseudo protocol, and can be used in
hyperlinks, allthough not advisable because the link will fail in JS
challanged browsers.
When you use an eventhandler (like the onClick) the browser knows it is JS,
so this is enough: OnClick="window.close();"

Regards,
Erwin Moller
besides, js can not close the last window.

bill
Feb 28 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.