Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    340
    Plugin Contributions
    0

    Default When looking for extra lines and spaces in php files...

    When looking for extra lines and spaces in php files, what excactly are they talking about
    I've the Rss feed addon and have to look for white spaces and lines in the begining and the end of files cause I get an error .

    My question : what should I be looking for ?

    This is reaaly a stupid question for most of you but I'm not familiar with php

  2. #2
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: When looking for extra lines and spaces in php files...

    Blank lines and spaces at the beginning or end of a php file can cause all sorts of problems with the php processor. Your php files should begin with

    Code:
    <?php
    and end with

    Code:
    ?>
    There shouldn't be any blank lines or spaces before or after those.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  3. #3
    Join Date
    Aug 2008
    Posts
    340
    Plugin Contributions
    0

    Default Re: When looking for extra lines and spaces in php files...

    I found a script that looks for these and it says I have a blank space at the end of this file:


    //DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . '

    || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
    ?>
    <?php echo rss_feed_link_alternate(); // RSS Feed ?>
    </head>
    <?php // NOTE: Blank line following is intended: ?>

    Where is the error?

  4. #4
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: When looking for extra lines and spaces in php files...

    It's impossible to tell this way. Open the file in question in a good text editor like Notepad++ or Crimson Editor (regular Notepad will do as well). Position your cursor after the closing ?> and delete any extra lines or spaces.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  5. #5
    Join Date
    Aug 2008
    Posts
    340
    Plugin Contributions
    0

    Default Re: When looking for extra lines and spaces in php files...

    This is the end of my html_header.php file:

    }

    //DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
    ?>
    <?php echo rss_feed_link_alternate(); // RSS Feed ?>
    </head>
    <?php // NOTE: Blank line following is intended: ?>

    Where to look?

  6. #6
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: When looking for extra lines and spaces in php files...

    Quote Originally Posted by lieven23 View Post
    This is the end of my html_header.php file:

    }

    //DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
    ?>
    <?php echo rss_feed_link_alternate(); // RSS Feed ?>
    </head>
    <?php // NOTE: Blank line following is intended: ?>

    Where to look?
    The file you have listed is intended to have a extra line (blank after it). Language files become "broken" when an additional linebreak or spaces follow the closing ?>

    Like this

    This is good
    Code:
    ?>
    This is not
    Code:
    ?>space
    or space
    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

 

 

Similar Threads

  1. v150 Looking for help Merging Files for Plugins
    By CnTGifts in forum General Questions
    Replies: 3
    Last Post: 27 Aug 2012, 06:39 AM
  2. php files called when accessing product_listing.php page
    By Tonyy in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 4 Dec 2011, 12:46 AM
  3. when looking for extra lines and spaces in php files...
    By lieven23 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 27 Aug 2009, 04:53 AM
  4. adding extra lines when in check out
    By svazquez in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 May 2009, 07:10 AM
  5. Extra '/' on links and other lines
    By prodesk in forum General Questions
    Replies: 11
    Last Post: 31 Dec 2006, 04:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg