Reply to Re: [PHP] header, location: mailto abd browsers

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация