|
Posted by Mikey on 09/07/05 13:06
Bernard Perrot wrote:
> hello,
>
> I have a little problem with this kind of script :
>
> <?php
> function mailto ($addr) {
> Header ("Location: mailto:$addr");
> }
>
> mailto("somebody@somewhere.tld");
> ?>
>
> When called from an html page, it open correctly un MUA from mailing,
> but with some browser (mozilla for example), the calling page is still
> displayed, and with some others (firefox for example), a new blank
> page is displayed (and I don't want).
>
> Any ideas about the problem ? How to solve it ?
>
> Best regards,
>
From the HTTP RFC:
The Location response-header field is used to redirect the recipient to
a location other than the Request-URI for completion of the request or
identification of a new resource. For 201 (Created) responses, the
Location is that of the new resource which was created by the request.
For 3xx responses, the location SHOULD indicate the server's preferred
URI for automatic redirection to the resource. The field value consists
of a single absolute URI.
Location = "Location" ":" absoluteURI
Your script doesn't appear to be trying to do a re-direct, but rather open a client side e-mail - if you want to do this, then you will need to use JavaScript on the client side.
HTH,
Mikey
Navigation:
[Reply to this message]
|