Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP quit navigator

sousimou@gmail.com
Guest
 
Posts: n/a
#1: Feb 27 '07
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


Mike Roetgers
Guest
 
Posts: n/a
#2: Feb 27 '07

re: PHP quit navigator


sousimou@gmail.com schrieb:
Quote:
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()"
bill
Guest
 
Posts: n/a
#3: Feb 27 '07

re: PHP quit navigator


sousimou@gmail.com wrote:
Quote:
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
Erwin Moller
Guest
 
Posts: n/a
#4: Feb 27 '07

re: PHP quit navigator


Mike Roetgers wrote:
Quote:
sousimou@gmail.com schrieb:
Quote:
>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
Kimmo Laine
Guest
 
Posts: n/a
#5: Feb 27 '07

re: PHP quit navigator


sousimou@gmail.com kirjoitti:
Quote:
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ö
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
bill
Guest
 
Posts: n/a
#6: Feb 28 '07

re: PHP quit navigator


Erwin Moller wrote:
Quote:
Mike Roetgers wrote:
>
Quote:
>sousimou@gmail.com schrieb:
Quote:
>>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
Closed Thread


Similar PHP bytes