FAQ
I have a customer that wants to return a 403 Forbidden header/page when
certain conditions are met. I looked through the online manual and all
the examples listed would not work.

This is what I am using.

header("Location: HTTP/1.0 403");

PHP tried to send the user to a "HTTP/1.0 403" webpage.

Any ideas?

CDitty

------------------------------------------------------------------------------
03/27/2003, 09:42:13 AM
This e-mail and any attachments represent the views and opinions of only the sender and are not necessarily those of Memphis Light, Gas & Water Division, and no such inference should be made.

==============================================================================

Search Discussions

  • Matt Schroebel at Mar 27, 2003 at 3:53 pm

    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 10:42 AM
    To: php-general@lists.php.net
    Subject: [PHP] How to Return 403 Forbidden headers
    header('HTTP/1.0 403 Forbidden');
  • Christopher Ditty at Mar 27, 2003 at 3:59 pm
    Thanks, but it returns a blank page.
    "Matt Schroebel" <MSchroebel@hsus.org> 03/27/03 09:52AM >>>
    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 10:42 AM
    To: php-general@lists.php.net
    Subject: [PHP] How to Return 403 Forbidden headers
    header('HTTP/1.0 403 Forbidden');


    ------------------------------------------------------------------------------
    03/27/2003, 09:59:06 AM
    This e-mail and any attachments represent the views and opinions of only the sender and are not necessarily those of Memphis Light, Gas & Water Division, and no such inference should be made.

    ==============================================================================
  • Ray Hunter at Mar 27, 2003 at 4:54 pm
    What browser are you using...

    IE has its own 404 pages that it displays when it gets those types of
    headers.

    --
    Ray
    On Thu, 2003-03-27 at 08:58, Christopher Ditty wrote:
    Thanks, but it returns a blank page.
    "Matt Schroebel" <MSchroebel@hsus.org> 03/27/03 09:52AM >>>
    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 10:42 AM
    To: php-general@lists.php.net
    Subject: [PHP] How to Return 403 Forbidden headers
    header('HTTP/1.0 403 Forbidden');


    ------------------------------------------------------------------------------
    03/27/2003, 09:59:06 AM
    This e-mail and any attachments represent the views and opinions of only the sender and are not necessarily those of Memphis Light, Gas & Water Division, and no such inference should be made.

    ==============================================================================
  • Serge Paquin at Mar 27, 2003 at 5:00 pm
    This this point the only thing you have done is overridden the status code.

    You still have to send something to the browser. HTTP/1.0 403 Forbidden is not a page or a location. It's a result code. You could then do something as simple as:

    print "You are forbidden to view this page";


    Serge.



    On Thu, 27 Mar 2003 09:58:49 -0600
    "Christopher Ditty" wrote:
    Thanks, but it returns a blank page.
    "Matt Schroebel" <MSchroebel@hsus.org> 03/27/03 09:52AM >>>
    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 10:42 AM
    To: php-general@lists.php.net
    Subject: [PHP] How to Return 403 Forbidden headers
    header('HTTP/1.0 403 Forbidden');


    ------------------------------------------------------------------------------
    03/27/2003, 09:59:06 AM
    This e-mail and any attachments represent the views and opinions of only the sender and are not necessarily those of Memphis Light, Gas & Water Division, and no such inference should be made.

    ==============================================================================


    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
  • Jeff Lewis at Mar 27, 2003 at 5:11 pm
    We're sending out emails using mail() and sending it in HTML format and
    while most people get it correctly a couple are not. They get the anti-abuse
    headers and then the HTML code appears as just that - HTML code in the body
    of the email.

    Sending those same people an HTML email composed in Outlook comes across
    just fine, perhaps it's the anti abuse headers causing the issue?

    Has anyone heard or had experience with this?

    Jeff
  • Jeff Lewis at Mar 27, 2003 at 6:48 pm
    A bit more information on this...here is the code being used:

    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

    /* additional headers */
    $headers .= "From: Jeff <jeff@hyrum.net>\r\n";

    $message = "test";
    mail ('someone@someone.com', 'Quote of the Week from Jeff', $message,
    $headers);

    And again, it works for most people but two people have complained about
    this issue. At least one as using MS Outlook.

    Jeff


    ----- Original Message -----
    From: "Jeff Lewis" <jeff@hyrum.net>
    To: <php-general@lists.php.net>
    Sent: Thursday, March 27, 2003 12:14 PM
    Subject: [PHP] HTML mail being sent with mail() not working for some people

    We're sending out emails using mail() and sending it in HTML format and
    while most people get it correctly a couple are not. They get the
    anti-abuse
    headers and then the HTML code appears as just that - HTML code in the body
    of the email.

    Sending those same people an HTML email composed in Outlook comes across
    just fine, perhaps it's the anti abuse headers causing the issue?

    Has anyone heard or had experience with this?

    Jeff





    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php

  • Don Read at Mar 27, 2003 at 7:39 pm

    On 27-Mar-2003 Jeff Lewis wrote:
    We're sending out emails using mail() and sending it in HTML format and
    while most people get it correctly a couple are not. They get the
    anti-abuse
    headers and then the HTML code appears as just that - HTML code in the
    body
    of the email.

    Sending those same people an HTML email composed in Outlook comes across
    just fine, perhaps it's the anti abuse headers causing the issue?

    Has anyone heard or had experience with this?
    google 'mime multipart alternative HTML'

    Regards,
    --
    Don Read dread@texas.net
    -- It's always darkest before the dawn. So if you are going to
    steal the neighbor's newspaper, that's the time to do it.
    (53kr33t w0rdz: sql table query)
  • Manuel Lemos at Mar 28, 2003 at 3:48 am
    Hello,
    On 03/27/2003 02:14 PM, Jeff Lewis wrote:
    We're sending out emails using mail() and sending it in HTML format and
    while most people get it correctly a couple are not. They get the anti-abuse
    headers and then the HTML code appears as just that - HTML code in the body
    of the email.

    Sending those same people an HTML email composed in Outlook comes across
    just fine, perhaps it's the anti abuse headers causing the issue?
    That seems like a bug in the mail() function that makes messages look
    they have some kind of virus, I was told.

    You may want to try this class that provides workaround for many mail()
    function problems:

    http://www.phpclasses.org/mimemessage


    --

    Regards,
    Manuel Lemos
  • Matt Schroebel at Mar 27, 2003 at 4:09 pm

    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 10:59 AM
    To: Matt Schroebel; php-general@lists.php.net
    Subject: RE: [PHP] How to Return 403 Forbidden headers


    Thanks, but it returns a blank page.
    Works for me in I.E 6.

    <?php
    header('HTTP/1.0 403 Forbidden');
    ?>
  • Alexander Weber at Mar 27, 2003 at 4:22 pm
    For sure, has to be sent before any text and has to be part of a PHP script!

    Alex

    "Matt Schroebel" <MSchroebel@hsus.org> schrieb im Newsbeitrag
    news:D4DB668A680B2549AE977FB0B193E2E86DD722@email.hsus.org...

    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 10:59 AM
    To: Matt Schroebel; php-general@lists.php.net
    Subject: RE: [PHP] How to Return 403 Forbidden headers


    Thanks, but it returns a blank page.
    Works for me in I.E 6.

    <?php
    header('HTTP/1.0 403 Forbidden');
    ?>
  • Matt Schroebel at Mar 27, 2003 at 4:57 pm

    -----Original Message-----
    From: Christopher Ditty
    Sent: Thursday, March 27, 2003 11:15 AM
    To: Matt Schroebel
    Subject: RE: [PHP] How to Return 403 Forbidden headers


    Try it in Netscape 7 if you have it.
    6.5 showed blank, and if you add html it shows up. Hmmmm
  • Serge Paquin at Mar 27, 2003 at 4:58 pm
    Almost.

    It's not the Location Header you want to play with.

    header("HTTP/1.0 403 Forbidden");

    will do the job.

    Serge.

    On Thu, 27 Mar 2003 09:41:57 -0600
    "Christopher Ditty" wrote:
    I have a customer that wants to return a 403 Forbidden header/page when
    certain conditions are met. I looked through the online manual and all
    the examples listed would not work.

    This is what I am using.

    header("Location: HTTP/1.0 403");

    PHP tried to send the user to a "HTTP/1.0 403" webpage.

    Any ideas?

    CDitty

    ------------------------------------------------------------------------------
    03/27/2003, 09:42:13 AM
    This e-mail and any attachments represent the views and opinions of only the sender and are not necessarily those of Memphis Light, Gas & Water Division, and no such inference should be made.

    ==============================================================================


    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-general @
categoriesphp
postedMar 27, '03 at 3:42p
activeMar 28, '03 at 3:48a
posts13
users8
websitephp.net

People

Translate

site design / logo © 2022 Grokbase