output buffering, parse error unexpected t_string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JRough

    output buffering, parse error unexpected t_string



    I'm trying to use output buffering to cheat so i can print to excel
    which is called later than this header().


    header("Content-type: application/xmsdownload");
    header("Content-Disposition: attachment;
    header("Pragma: no-cache");
    header("Expires ; 0");
    print "$header\n$data ";


    This is the header line it conflicts with so I surrounded it with the
    buffer.
    ob_start()
    header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
    obj_end_flush()
    exit;

    I have a question is this buffer supposed to go around the whole php
    page or only the offending header line?

    I am getting an error message on the header line " Parse error: syntax
    error, unexpected T_STRING in /home/allrail/public_html/header.php on
    line 39"

    It worked before I put the buffer around it?

    thanks,

  • Captain Paralytic

    #2
    Re: output buffering, parse error unexpected t_string

    On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
    I'm trying to use output buffering to cheat so i can  print to excel
    which is called later than this header().
    >
            header("Content-type: application/xmsdownload");
            header("Content-Disposition: attachment;
            header("Pragma: no-cache");
            header("Expires ; 0");
            print "$header\n$data ";
    >
    This is the header line it conflicts with so I surrounded it with the
    buffer.
    ob_start()
    header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
    obj_end_flush()
    exit;
    >
    I have a question is this buffer supposed to go around the whole php
    page or only the offending header line?
    >
    I am getting an error message on the header line " Parse error: syntax
    error, unexpected T_STRING in /home/allrail/public_html/header.php on
    line 39"
    >
    It worked before I put the buffer around it?
    >
    thanks,
    you have forgotton the semi-colons!

    Comment

    • JRough

      #3
      Re: output buffering, parse error unexpected t_string

      On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
      On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
      >
      >
      >
      I'm trying to use output buffering to cheat so i can  print to excel
      which is called later than this header().
      >
              header("Content-type: application/xmsdownload");
              header("Content-Disposition: attachment;
              header("Pragma: no-cache");
              header("Expires ; 0");
              print "$header\n$data ";
      >
      This is the header line it conflicts with so I surrounded it with the
      buffer.
      ob_start()
      header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
      obj_end_flush()
      exit;
      >
      I have a question is this buffer supposed to go around the whole php
      page or only the offending header line?
      >
      I am getting an error message on the header line " Parse error: syntax
      error, unexpected T_STRING in /home/allrail/public_html/header.php on
      line 39"
      >
      It worked before I put the buffer around it?
      >
      thanks,
      >
      you have forgotton the semi-colons!
      oh thanks, it has been a long week but it still doesn't work? Now it
      says ob_end_flush() is an undefined function.
      "
      Fatal error: Call to undefined function obj_end_flush() in /home/
      allrail/public_html/header.php on line 40"

      Why is that?

      Comment

      • JRough

        #4
        Re: output buffering, parse error unexpected t_string

        On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
        On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
        >
        >
        >
        I'm trying to use output buffering to cheat so i can  print to excel
        which is called later than this header().
        >
                header("Content-type: application/xmsdownload");
                header("Content-Disposition: attachment;
                header("Pragma: no-cache");
                header("Expires ; 0");
                print "$header\n$data ";
        >
        This is the header line it conflicts with so I surrounded it with the
        buffer.
        ob_start()
        header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
        obj_end_flush()
        exit;
        >
        I have a question is this buffer supposed to go around the whole php
        page or only the offending header line?
        >
        I am getting an error message on the header line " Parse error: syntax
        error, unexpected T_STRING in /home/allrail/public_html/header.php on
        line 39"
        >
        It worked before I put the buffer around it?
        >
        thanks,
        >
        you have forgotton the semi-colons!
        okay, thanks, but I still have an error. Now it is on the preceeding
        line 40.
        It says obj_end_flush() is an undefined function.
        "Fatal error: Call to undefined function obj_end_flush() in /home/
        allrail/public_html/header.php on line 40"
        How can I fix that?

        Comment

        • Captain Paralytic

          #5
          Re: output buffering, parse error unexpected t_string

          On 26 Sep, 22:54, JRough <jlro...@yahoo. comwrote:
          On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
          >
          >
          >
          On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
          >
          I'm trying to use output buffering to cheat so i can  print to excel
          which is called later than this header().
          >
                  header("Content-type: application/xmsdownload");
                  header("Content-Disposition: attachment;
                  header("Pragma: no-cache");
                  header("Expires ; 0");
                  print "$header\n$data ";
          >
          This is the header line it conflicts with so I surrounded it with the
          buffer.
          ob_start()
          header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
          obj_end_flush()
          exit;
          >
          I have a question is this buffer supposed to go around the whole php
          page or only the offending header line?
          >
          I am getting an error message on the header line " Parse error: syntax
          error, unexpected T_STRING in /home/allrail/public_html/header.php on
          line 39"
          >
          It worked before I put the buffer around it?
          >
          thanks,
          >
          you have forgotton the semi-colons!
          >
          okay, thanks, but I still have an error.  Now it is on the preceeding
          line 40.
          It says obj_end_flush() is an undefined function.
          "Fatal error: Call to undefined function obj_end_flush() in /home/
          allrail/public_html/header.php on line 40"
          How can I fix that?
          by using the correct function name. You really must pay attention to
          what the errors say and start looking things up in the manual!

          Comment

          • Captain Paralytic

            #6
            Re: output buffering, parse error unexpected t_string

            On 26 Sep, 22:54, JRough <jlro...@yahoo. comwrote:
            On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
            >
            >
            >
            On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
            >
            I'm trying to use output buffering to cheat so i can  print to excel
            which is called later than this header().
            >
                    header("Content-type: application/xmsdownload");
                    header("Content-Disposition: attachment;
                    header("Pragma: no-cache");
                    header("Expires ; 0");
                    print "$header\n$data ";
            >
            This is the header line it conflicts with so I surrounded it with the
            buffer.
            ob_start()
            header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
            obj_end_flush()
            exit;
            >
            I have a question is this buffer supposed to go around the whole php
            page or only the offending header line?
            >
            I am getting an error message on the header line " Parse error: syntax
            error, unexpected T_STRING in /home/allrail/public_html/header.php on
            line 39"
            >
            It worked before I put the buffer around it?
            >
            thanks,
            >
            you have forgotton the semi-colons!
            >
            okay, thanks, but I still have an error.  Now it is on the preceeding
            line 40.
            It says obj_end_flush() is an undefined function.
            "Fatal error: Call to undefined function obj_end_flush() in /home/
            allrail/public_html/header.php on line 40"
            How can I fix that?
            Don't you think it's time that you realised that programming is not
            your forte? You simply don't have the attention to detail or the
            intelligence to carry it off.

            Comment

            • JRough

              #7
              Re: output buffering, parse error unexpected t_string

              On Sep 26, 3:00 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
              On 26 Sep, 22:54, JRough <jlro...@yahoo. comwrote:
              >
              >
              >
              On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
              >
              On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
              >
              I'm trying to use output buffering to cheat so i can  print to excel
              which is called later than this header().
              >
                      header("Content-type: application/xmsdownload");
                      header("Content-Disposition: attachment;
                      header("Pragma: no-cache");
                      header("Expires ; 0");
                      print "$header\n$data ";
              >
              This is the header line it conflicts with so I surrounded it with the
              buffer.
              ob_start()
              header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
              obj_end_flush()
              exit;
              >
              I have a question is this buffer supposed to go around the whole php
              page or only the offending header line?
              >
              I am getting an error message on the header line " Parse error: syntax
              error, unexpected T_STRING in /home/allrail/public_html/header.php on
              line 39"
              >
              It worked before I put the buffer around it?
              >
              thanks,
              >
              you have forgotton the semi-colons!
              >
              okay, thanks, but I still have an error.  Now it is on the preceeding
              line 40.
              It says obj_end_flush() is an undefined function.
              "Fatal error: Call to undefined function obj_end_flush() in /home/
              allrail/public_html/header.php on line 40"
              How can I fix that?
              >
              by using the correct function name. You really must pay attention to
              what the errors say and start looking things up in the manual!
              sorry,
              in any case, it now compiles and brings the page however, if I leave
              the exit;
              step I only get a blank web page, so I guess it exits all the way
              out? if I leave the exit; step then I get the same error as before:
              Warning: Cannot modify header information - headers already sent by
              (output started at /home/allrail/public_html/header.php:40) in /home/
              allrail/public_html/header.php on line 39

              does that mean I can't use the buffer?
              thanks,

              Comment

              • JRough

                #8
                Re: output buffering, parse error unexpected t_string

                On Sep 26, 3:23 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
                On 26 Sep, 22:54, JRough <jlro...@yahoo. comwrote:
                >
                >
                >
                On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
                >
                On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
                >
                I'm trying to use output buffering to cheat so i can  print to excel
                which is called later than this header().
                >
                        header("Content-type: application/xmsdownload");
                        header("Content-Disposition: attachment;
                        header("Pragma: no-cache");
                        header("Expires ; 0");
                        print "$header\n$data ";
                >
                This is the header line it conflicts with so I surrounded it with the
                buffer.
                ob_start()
                header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                obj_end_flush()
                exit;
                >
                I have a question is this buffer supposed to go around the whole php
                page or only the offending header line?
                >
                I am getting an error message on the header line " Parse error: syntax
                error, unexpected T_STRING in /home/allrail/public_html/header.php on
                line 39"
                >
                It worked before I put the buffer around it?
                >
                thanks,
                >
                you have forgotton the semi-colons!
                >
                okay, thanks, but I still have an error.  Now it is on the preceeding
                line 40.
                It says obj_end_flush() is an undefined function.
                "Fatal error: Call to undefined function obj_end_flush() in /home/
                allrail/public_html/header.php on line 40"
                How can I fix that?
                >
                Don't you think it's time that you realised that programming is not
                your forte? You simply don't have the attention to detail or the
                intelligence to carry it off.
                sorry for the typos. Now it compiles and gives a blank page presumably
                the exit; step? Without the exit step I get a fatal error to another
                function on an included page. Does this mean that the buffer won't
                work here?

                Comment

                • Jerry Stuckle

                  #9
                  Re: output buffering, parse error unexpected t_string

                  JRough wrote:
                  On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
                  >On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
                  >>
                  >>
                  >>
                  >>I'm trying to use output buffering to cheat so i can print to excel
                  >>which is called later than this header().
                  >> header("Content-type: application/xmsdownload");
                  >> header("Content-Disposition: attachment;
                  >> header("Pragma: no-cache");
                  >> header("Expires ; 0");
                  >> print "$header\n$data ";
                  >>This is the header line it conflicts with so I surrounded it with the
                  >>buffer.
                  >>ob_start()
                  >>header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                  >>obj_end_flush ()
                  >>exit;
                  >>I have a question is this buffer supposed to go around the whole php
                  >>page or only the offending header line?
                  >>I am getting an error message on the header line " Parse error: syntax
                  >>error, unexpected T_STRING in /home/allrail/public_html/header.php on
                  >>line 39"
                  >>It worked before I put the buffer around it?
                  >>thanks,
                  >you have forgotton the semi-colons!
                  >
                  oh thanks, it has been a long week but it still doesn't work? Now it
                  says ob_end_flush() is an undefined function.
                  "
                  Fatal error: Call to undefined function obj_end_flush() in /home/
                  allrail/public_html/header.php on line 40"
                  >
                  Why is that?
                  >
                  Because you have:

                  obj_end_flush() ;

                  Not

                  ob_end_flush();

                  But if you're trying to output an excel spreadsheet they bring up in
                  excel, you're going about it the wrong way. You can only have one
                  content type for a particular file, and this one needs to be text/html
                  (because you're also outputting html).

                  What you need to do is create another file which sets the content type
                  for THAT file

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • JRough

                    #10
                    Re: output buffering, parse error unexpected t_string

                    On Sep 26, 6:08 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                    JRough wrote:
                    On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
                    On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
                    >
                    >I'm trying to use output buffering to cheat so i can  print to excel
                    >which is called later than this header().
                    >        header("Content-type: application/xmsdownload");
                    >        header("Content-Disposition: attachment;
                    >        header("Pragma: no-cache");
                    >        header("Expires ; 0");
                    >        print "$header\n$data ";
                    >This is the header line it conflicts with so I surrounded it with the
                    >buffer.
                    >ob_start()
                    >header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                    >obj_end_flush( )
                    >exit;
                    >I have a question is this buffer supposed to go around the whole php
                    >page or only the offending header line?
                    >I am getting an error message on the header line " Parse error: syntax
                    >error, unexpected T_STRING in /home/allrail/public_html/header.php on
                    >line 39"
                    >It worked before I put the buffer around it?
                    >thanks,
                    you have forgotton the semi-colons!
                    >
                    oh thanks, it has been a long week but it still doesn't work?  Now it
                    says ob_end_flush() is an undefined function.
                    "
                    Fatal error: Call to undefined function obj_end_flush() in /home/
                    allrail/public_html/header.php on line 40"
                    >
                    Why is that?
                    >
                    Because you have:
                    >
                    obj_end_flush() ;
                    >
                    Not
                    >
                    ob_end_flush();
                    >
                    But if you're trying to output an excel spreadsheet they bring up in
                    excel, you're going about it the wrong way.  You can only have one
                    content type for a particular file, and this one needs to be text/html
                    (because you're also outputting html).
                    >
                    What you need to do is create another file which sets the content type
                    for THAT file
                    >
                    --
                    =============== ===
                    Remove the "x" from my email address
                    Jerry Stuckle
                    JDS Computer Training Corp.
                    jstuck...@attgl obal.net
                    =============== ===
                    Are you saying that the content type of the excel print statement:

                    header("Content-type: application/xmsdownload");
                    conflicts with

                    the text type in the header?
                    header( 'Content-type: text/html; charset=\"$CHAR SET\"' );

                    I don't know about the ob_start() and ob_end_flush() statement. It
                    didn't seem to work in this case. Everytime I used it with the exit
                    after the flush I got a blank page with nothing no header no footer,
                    nothing.


                    I just decided to do a hack and requeried the database for the excel
                    print. There are all these nested if's I can't get out of. All I
                    need is the $mark and $number and my hack works. I have a question
                    about this form:

                    form action="/clm_history.php " method="post">

                    <tr>

                    <td>
                    <table cellspacing="0" cellpadding="2" border="0"
                    class="content" >
                    <tr><th colspan="7">Ent er car mark and number to view CLM
                    history</th></tr>

                    <tr><td class=td3 align="right">M ark</td>
                    <td><input type=text name='mark' size=5></td>

                    <td class=td3 align="right">N umber</td>
                    <td><input type=text name='num'></td>
                    </tr>
                    <tr>
                    <td></td>
                    <td></td>

                    <td></td>
                    <td align='right'>< input type=submit class='button'
                    value='Get History'</td>


                    shouldn't $_POST['mark'] and $_POST['num'] be posted when the user
                    posts to the form? If I can get the posted value then my hack will
                    work and I can go home.

                    P.s. thanks for being nice.

                    This validate_login is at the beginning of the page:


                    Validate_login( "clm_history.ph p?mark=".$mark. "&num=".$nu m);



                    Does that mean $mark and $num aren't posted?
                    thanks,

                    Comment

                    • Jerry Stuckle

                      #11
                      Re: output buffering, parse error unexpected t_string

                      JRough wrote:
                      On Sep 26, 6:08 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                      >JRough wrote:
                      >>On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
                      >>>On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
                      >>>>I'm trying to use output buffering to cheat so i can print to excel
                      >>>>which is called later than this header().
                      >>>> header("Content-type: application/xmsdownload");
                      >>>> header("Content-Disposition: attachment;
                      >>>> header("Pragma: no-cache");
                      >>>> header("Expires ; 0");
                      >>>> print "$header\n$data ";
                      >>>>This is the header line it conflicts with so I surrounded it with the
                      >>>>buffer.
                      >>>>ob_start( )
                      >>>>header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                      >>>>obj_end_flu sh()
                      >>>>exit;
                      >>>>I have a question is this buffer supposed to go around the whole php
                      >>>>page or only the offending header line?
                      >>>>I am getting an error message on the header line " Parse error: syntax
                      >>>>error, unexpected T_STRING in /home/allrail/public_html/header.php on
                      >>>>line 39"
                      >>>>It worked before I put the buffer around it?
                      >>>>thanks,
                      >>>you have forgotton the semi-colons!
                      >>oh thanks, it has been a long week but it still doesn't work? Now it
                      >>says ob_end_flush() is an undefined function.
                      >>"
                      >>Fatal error: Call to undefined function obj_end_flush() in /home/
                      >>allrail/public_html/header.php on line 40"
                      >>Why is that?
                      >Because you have:
                      >>
                      >obj_end_flush( );
                      >>
                      >Not
                      >>
                      >ob_end_flush() ;
                      >>
                      >But if you're trying to output an excel spreadsheet they bring up in
                      >excel, you're going about it the wrong way. You can only have one
                      >content type for a particular file, and this one needs to be text/html
                      >(because you're also outputting html).
                      >>
                      >What you need to do is create another file which sets the content type
                      >for THAT file
                      >>
                      Are you saying that the content type of the excel print statement:
                      >
                      header("Content-type: application/xmsdownload");
                      conflicts with
                      >
                      the text type in the header?
                      header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                      >
                      That's true. Each file the browser sees is fetched separately, and any
                      one file can only have a single content type.

                      For instance - your HTML page has a content type of text/html. If you
                      have an <img..tag, that points to another file whose content type
                      would be image/jpeg, image/gif, etc.

                      Your file needs to have content type of text/html. It cannot also have
                      a content type of application/xmsdownload.


                      I don't know about the ob_start() and ob_end_flush() statement. It
                      didn't seem to work in this case. Everytime I used it with the exit
                      after the flush I got a blank page with nothing no header no footer,
                      nothing.
                      >
                      It won't work, because you're trying to give that file two different
                      content types. That is not allowed.
                      >
                      I just decided to do a hack and requeried the database for the excel
                      print. There are all these nested if's I can't get out of. All I
                      need is the $mark and $number and my hack works. I have a question
                      about this form:
                      >
                      form action="/clm_history.php " method="post">
                      >
                      <tr>
                      >
                      <td>
                      <table cellspacing="0" cellpadding="2" border="0"
                      class="content" >
                      <tr><th colspan="7">Ent er car mark and number to view CLM
                      history</th></tr>
                      >
                      <tr><td class=td3 align="right">M ark</td>
                      <td><input type=text name='mark' size=5></td>
                      >
                      <td class=td3 align="right">N umber</td>
                      <td><input type=text name='num'></td>
                      </tr>
                      <tr>
                      <td></td>
                      <td></td>
                      >
                      <td></td>
                      <td align='right'>< input type=submit class='button'
                      value='Get History'</td>
                      >
                      >
                      shouldn't $_POST['mark'] and $_POST['num'] be posted when the user
                      posts to the form? If I can get the posted value then my hack will
                      work and I can go home.
                      >
                      Yes, they will. But you still can't have two content types for one file.
                      P.s. thanks for being nice.
                      >
                      This validate_login is at the beginning of the page:
                      >
                      >
                      Validate_login( "clm_history.ph p?mark=".$mark. "&num=".$nu m);
                      >
                      >
                      >
                      Does that mean $mark and $num aren't posted?
                      thanks,
                      >
                      No, $mark is not $_POST['mark']! (unless register_global s is on, which
                      is should NOT be).

                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • JRough

                        #12
                        Re: output buffering, parse error unexpected t_string

                        On Sep 26, 7:15 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                        JRough wrote:
                        On Sep 26, 6:08 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                        JRough wrote:
                        >On Sep 26, 2:26 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
                        >>On 26 Sep, 22:20, JRough <jlro...@yahoo. comwrote:
                        >>>I'm trying to use output buffering to cheat so i can  print to excel
                        >>>which is called later than this header().
                        >>>        header("Content-type: application/xmsdownload");
                        >>>        header("Content-Disposition: attachment;
                        >>>        header("Pragma: no-cache");
                        >>>        header("Expires ; 0");
                        >>>        print "$header\n$data ";
                        >>>This is the header line it conflicts with so I surrounded it with the
                        >>>buffer.
                        >>>ob_start()
                        >>>header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                        >>>obj_end_flus h()
                        >>>exit;
                        >>>I have a question is this buffer supposed to go around the whole php
                        >>>page or only the offending header line?
                        >>>I am getting an error message on the header line " Parse error: syntax
                        >>>error, unexpected T_STRING in /home/allrail/public_html/header.php on
                        >>>line 39"
                        >>>It worked before I put the buffer around it?
                        >>>thanks,
                        >>you have forgotton the semi-colons!
                        >oh thanks, it has been a long week but it still doesn't work?  Now it
                        >says ob_end_flush() is an undefined function.
                        >"
                        >Fatal error: Call to undefined function obj_end_flush() in /home/
                        >allrail/public_html/header.php on line 40"
                        >Why is that?
                        Because you have:
                        >
                        obj_end_flush() ;
                        >
                        Not
                        >
                        ob_end_flush();
                        >
                        But if you're trying to output an excel spreadsheet they bring up in
                        excel, you're going about it the wrong way.  You can only have one
                        content type for a particular file, and this one needs to be text/html
                        (because you're also outputting html).
                        >
                        What you need to do is create another file which sets the content type
                        for THAT file
                        >
                        Are you saying that the content type of the excel print statement:
                        >
                           header("Content-type: application/xmsdownload");
                        conflicts with
                        >
                         the text type in the header?
                        header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
                        >
                        That's true.  Each file the browser sees is fetched separately, and any
                        one file can only have a single content type.
                        >
                        For instance - your HTML page has a content type of text/html.  If you
                        have an <img..tag, that points to another file whose content type
                        would be image/jpeg, image/gif, etc.
                        >
                        Your file needs to have content type of text/html.  It cannot also have
                        a content type of application/xmsdownload.
                        >
                        I don't know about the ob_start() and ob_end_flush() statement.  It
                        didn't seem to work in this case.  Everytime I used it with the exit
                        after the flush I got a blank page with nothing no header no footer,
                        nothing.
                        >
                        It won't work, because you're trying to give that file two different
                        content types.  That is not allowed.
                        >
                        >
                        >
                        >
                        >
                        I just decided to do a hack and requeried the database for the excel
                        print.  There are all these nested if's I can't get out of.  All I
                        need is the $mark and $number and my hack works.  I have a question
                        about this form:
                        >
                        form action="/clm_history.php " method="post">
                        >
                                <tr>
                        >
                                <td>
                                <table cellspacing="0" cellpadding="2" border="0"
                        class="content" >
                                <tr><th colspan="7">Ent er car mark and number to viewCLM
                        history</th></tr>
                        >
                                <tr><td class=td3 align="right">M ark</td>
                                    <td><input type=text name='mark' size=5></td>
                        >
                                    <td class=td3 align="right">N umber</td>
                                    <td><input type=text name='num'></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>
                        >
                                    <td></td>
                                    <td align='right'>< input type=submit class='button'
                        value='Get History'</td>
                        >
                        shouldn't $_POST['mark'] and $_POST['num'] be posted when the user
                        posts to the form?  If I can get the posted value then my hack will
                        work and I can go home.
                        >
                        Yes, they will.  But you still can't have two content types for one file.
                        >
                        P.s.  thanks for being nice.
                        >
                        This validate_login is at the beginning of the  page:
                        >
                        Validate_login( "clm_history.ph p?mark=".$mark. "&num=".$nu m);

                        It is not a separate php page. It is all on the same php page so the
                        scope should be okay.
                        But it branches from an if/else to the next page. I really don't know
                        why $mark and $num don't get passed any. It is a mystery. This query
                        is posted twice once for excel and once for the list. I also tried
                        making $result a global so I didn't have to query twice. That didn't
                        work either. Is that because it is an array?
                        thanks,


                        $result = SELECT_clm($mar k,$num);


                        Validate_login( "clm_history.ph p?mark=".$mark. "&num=".$nu m);


                        if($_SESSION["LMS_USER_D ESC"]=='customer'){
                        $id = $_SESSION["LMS_LOGGED _IN"];
                        }


                        if($mark&&$num) {

                        $TPL_carnumbers = GetHeaders($_SE SSION["LMS_USER_D ESC"]);

                        $mark = $mark = strtoupper($mar k);




                        # GET CARS FOR GIVEN ID AND TYPE?
                        $result = SELECT_clm($mar k,$num);

                        if(mysql_numrow s($result)==0){
                        $TPL_error_valu e = "No Data for this Carnumber - Please Enter
                        Another Mark and Number";
                        $template = "clm_history_ph p.html";
                        }else{
                        while ($row = mysql_fetch_ass oc($result)){
                        $TPL_carnumbers .=MakeSighting( $_SESSION["LMS_USER_D ESC"],$row);
                        }

                        $MSG_carlist = "SIGHTING HISTORY FOR ".MakeCarnumber ($mark,$num);
                        $TPL_carnumbers .="</table>";
                        $template = "template_carli st.html";



                        }

                        }else{

                        $template = "clm_history_ph p.html";

                        }

                        if ($_POST['assign']=='Open in Excel'){
                        $result = SELECT_clm($mar k,$num);

                        $file_name = "CLM_Histor y";







                        }
                        include "header.php ";
                        include $template_path. $template;
                        include "footer.php ";

                        Comment

                        Working...