how to open a dialog box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • R.G. Vervoort

    #1

    how to open a dialog box

    How can i open an authentication dialog box. I used the following code:

    <?php

    header('WWW-Authenticate: Basic realm=Private') ;
    header('HTTP/1.0 401 Unauthorized');
    exit;

    ?>


    This keeps giving an error message like:

    Warning: Cannot modify header information - headers already sent by (output
    started at /var/www/html/inlog1/form.php:2) in /var/www/html/inlog1/form.php
    on line 4

    Warning: Cannot modify header information - headers already sent by (output
    started at /var/www/html/inlog1/form.php:2) in /var/www/html/inlog1/form.php
    on line 5


    What am i doing wrong


    roy
    netherlands


  • Allan Rydberg

    #2
    Re: how to open a dialog box



    your scripts generate output before it gets to the header()
    lines. check all print statements and check for newlines
    before/after the <? ?>




    R.G. Vervoort wrote:
    [color=blue]
    > How can i open an authentication dialog box. I used the following code:
    >
    > <?php
    >
    > header('WWW-Authenticate: Basic realm=Private') ;
    > header('HTTP/1.0 401 Unauthorized');
    > exit;
    >
    > ?>
    >
    >
    > This keeps giving an error message like:
    >
    > Warning: Cannot modify header information - headers already sent by (output
    > started at /var/www/html/inlog1/form.php:2) in /var/www/html/inlog1/form.php
    > on line 4
    >
    > Warning: Cannot modify header information - headers already sent by (output
    > started at /var/www/html/inlog1/form.php:2) in /var/www/html/inlog1/form.php
    > on line 5
    >
    >
    > What am i doing wrong
    >
    >
    > roy
    > netherlands
    >
    >[/color]

    Comment

    • Inuyasha4Life

      #3
      Re: how to open a dialog box

      R.G. Vervoort wrote:
      [color=blue]
      > How can i open an authentication dialog box. I used the following code:
      >
      > <?php
      >
      > header('WWW-Authenticate: Basic realm=Private') ;
      > header('HTTP/1.0 401 Unauthorized');
      > exit;
      >
      > ?>
      >
      >
      > This keeps giving an error message like:
      >
      > Warning: Cannot modify header information - headers already sent by
      > (output started at /var/www/html/inlog1/form.php:2) in
      > /var/www/html/inlog1/form.php on line 4
      >
      > Warning: Cannot modify header information - headers already sent by
      > (output started at /var/www/html/inlog1/form.php:2) in
      > /var/www/html/inlog1/form.php on line 5
      >
      >
      > What am i doing wrong
      >
      >
      > roy
      > netherlands[/color]

      Ensure there's nothing before the <? in the file. I.E., the following would
      NOT work:

      <HTML>
      <?php
      header( ...........
      ...
      ?>

      This is because as soon as the program encounters the <HTML>, it's sent --
      no more information can be processed to the header. Also make sure there's
      no blank lines before <?php. It must be the first line. Period.

      -- Inuyasha4Life

      Comment

      Working...