Re: output buffering, parse error unexpected t_string

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

    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.
    without the exit I get this again:
    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
    as well as this:
    Fatal error: Cannot redeclare maketr() (previously declared in /home/
    allrail/public_html/templates/menu.php.html:2 4) in /home/allrail/
    public_html/templates/menu.php.html on line 33

    -----tr function----
    function MakeTR($menu_id ,$menu_name){
    $span_id = $menu_name.$men u_id;
    $div_id = "menu".$menu_id ;
    return "<tr>
    <td>
    <div class='menuOut' id='".$div_id." ' onclick=\"Switc hMenu('"..
    $span_id."')\" onclick=\"Chang eClass('".$div_ id."','menuOut' )\">
    <div id='imgSep'>
    <img src='".$SETTING['siteurl']."images/transparent.gif '
    width='10' height='10'></div>".strtouppe r($menu_name)." </div>
    <span class='submenu' id='".$span_id. "'>";
    }
Working...