extra ?> shows up on every page

Discussion in 'PHP' started by aayybb, Aug 5, 2009.

  1. #1
    Hi,

    I have extra ?> shows up on every page on screen. If I do a view page with browser it is right before <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

    How can I find it in the codes and get rid of it? I don't know which file causes it?
     
    aayybb, Aug 5, 2009 IP
  2. 4chp

    4chp Peon

    Messages:
    163
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You will need to look into your header.php file.
     
    4chp, Aug 5, 2009 IP
  3. aayybb

    aayybb Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The header is after <body> , not before <!doctype , so I don't think it is the problem. Any more suggestion?
     
    aayybb, Aug 5, 2009 IP
  4. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #4
    um, header usually contains the doctype and the head statement though it sounds like you are confusing a graphic header with the HTML header. Might want to clarify what it is you are working with here. Is it wordpress, a custom script or some other CMS?
     
    shallowink, Aug 5, 2009 IP
  5. 4chp

    4chp Peon

    Messages:
    163
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5

    What? You will need to edit the header.php file do you have one?
     
    4chp, Aug 5, 2009 IP
  6. aayybb

    aayybb Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Sorry for not being clear.
    I am using oscommerce. The extra ?> is shown on every page under /admin.
    header.php for the /admin part looks ok to me.
     
    aayybb, Aug 5, 2009 IP
  7. 4chp

    4chp Peon

    Messages:
    163
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Please post the header.php in question wrapped around the
    CODE
    Code (markup):
    tags.
     
    4chp, Aug 5, 2009 IP
  8. aayybb

    aayybb Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <code><?php
    /*
    $Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2002 osCommerce

    Released under the GNU General Public License
    */

    if ($messageStack->size > 0) {
    echo $messageStack->output();
    }
    ?>
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td>
    <td align="right"><?php echo '<a href="http://www.oscommerce.com" target="_blank">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a>&nbsp;&nbsp;<a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?>&nbsp;&nbsp;</td>
    </tr>
    <tr class="headerBar">
    <td class="headerBarContent">&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_TOP . '</a>'; ?></td>
    <td class="headerBarContent" align="right"><?php echo '<a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a> &nbsp;|&nbsp; <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a> &nbsp;|&nbsp; <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>'; ?>&nbsp;&nbsp;</td>
    </tr>
    </table></code>
     
    aayybb, Aug 5, 2009 IP
  9. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #9
    That is not the file you should be looking for, find the file where this code is in:

    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    Code (markup):
     
    premiumscripts, Aug 5, 2009 IP
  10. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #10
    Start with index.php in /admin. Post the lines up to the DOCTYPE
     
    shallowink, Aug 5, 2009 IP
  11. aayybb

    aayybb Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I found it. Went through many of the include files to find it.
    Thanks for all the suggestions and help here.
     
    aayybb, Aug 6, 2009 IP