Dan
Dan

Reputation: 11

Remove blank line on every web page

I have 3 blank lines at the beginning of every page that is causing errors of an add-on with stamps.com. (PS I have worked closely with their support team). I can see the lines using firebug, but don't know which file is causing them. I am trying to REMOVE these lines but can't seem to locate them in the header and main_page php files, for templates, common and default folders.

I am using version 1.3.8a of Zen Cart.

The web site is pranajewelry.com

Any suggestions on which files in order of precedence and what special code I should look for?

Upvotes: 1

Views: 1399

Answers (7)

Khadka Pushpendra
Khadka Pushpendra

Reputation: 999

if you are using Dreamweaver try this out

  1. Open the file
  2. Click CTRL + F
  3. Select "Current document" in "Find in" (You can also select the folder if you have multiple files)
  4. Search in "Source code"
  5. Tick "Use regular expression"
  6. Type "[\r\n]{2,}"(without quotes) in "Find"
  7. Type "\n" (without quotes) in "Replace"
  8. Press "Replace All

Upvotes: 0

Glen Solsberry
Glen Solsberry

Reputation: 12320

Make sure to look after your closing ?> as well. Anything after it will be sent to output; this is actually a good reason why you shouldn't use the closing ?> at the end of your PHP files.

Upvotes: 0

Stewie
Stewie

Reputation: 3121

Locate this in your files in the directory (use search in files) and you will probably find the blank lines

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">

Upvotes: 0

paraguma
paraguma

Reputation: 187

hey if you want to remove blank line then replace that web page/s with "notepad++ software". it has advance text processing capability. or remove it with "macromedia dreamweaver 8.0" it has tag replacing options with you can replace blank lines present in all pages in website folder.

Upvotes: 0

Joel Etherton
Joel Etherton

Reputation: 37543

I'd say those lines would have to be in one of your first includes in your template. Quite possibly you may have whitespace outside of you <?php ?> blocks for your configuration or function include files.

Upvotes: 0

Wrikken
Wrikken

Reputation: 70500

  1. Ensure all output buffering is of.
  2. Call headers_sent($file,$line); at a point in time you know you already sent output (doesn't matter where, it can be at the end of the request).
  3. Voilà, $file & $line hold the position where output started.

If the return of headers_sent is true, but $line==0, you'll have to look into auto_prepends.

Upvotes: 1

Brad
Brad

Reputation: 163438

I am surprised that those 3 blank lines cause problems with anything.

Anyway, they could be just about anywhere. Look for any lines in your files that aren't within PHP tags. You could have a common include for example that has 3 blank lines at the end of it. It could be anything. Typically, it will be before or after your <?php ?> blocks.

Upvotes: 0

Related Questions