Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Getting a blank page after editing header.php

Getting a blank page after editing header.php

Views: 1,812

Results 1 to 14 of 14
10 Jun 2012, 7:09 PM
#1
flowersbymalena avatar

flowersbymalena

New Zenner

Join Date:
May 2012
Posts:
13
Plugin Contributions:
0

Getting a blank page after editing header.php

Hello & good day,

I am new to zc & to website design ... I have tried Looking for the answer in the forums ... But i might be looking in the wrong places ...

I would like suggestions for a plain text editor to run on the mac platfom (lion).

I have tried editing some php files using text edit ... I tried saving it as a plain text file, but when i upload the file to the server, the entire sites goes blank ... If i restore the From a backup, then the site comes back to live ... Which tells me that the file is being saved in a format which zencart doesn't like ...

Any adivse / suggestions would be greatly appreciated.

Thanks in advance.

Hector

10 Jun 2012, 7:31 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

TextEdit probably saved your changes in the RTF file format.

I very highly recommend BBEdit, from Barebones Software. I've been using BBE for at least 15 years. You can get it through the Mac Store or directly from Barebones. It's not expensive, but if you prefer, they offer a simpler editor called TextWrangler for free.

Rob

11 Jun 2012, 2:45 AM
#3
flowersbymalena avatar

flowersbymalena

New Zenner

Join Date:
May 2012
Posts:
13
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

thanks for the quick response ... so the main difference is just the features that they offer? ... i should be able to use either to do all the minor changes needed to manipulate templates?

11 Jun 2012, 4:46 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting a blank page after editing header.php

A broader list of software suggestions including other categories:
http://www.zen-cart.com/wiki/index.php/Useful_Tools

11 Jun 2012, 10:40 AM
#5
flowersbymalena avatar

flowersbymalena

New Zenner

Join Date:
May 2012
Posts:
13
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

@ drbyte ... Thanks ... I have no idea what i am doing wrong ... I have tried different programs, i have tried all possible settings for the programs that i have ... But every time that i change the header.php file, my site stops working, it displays a blank white page. I have even tried using vi, as basic a plain text editor as it gets, and still get the same results. I have no idea what i am doing wrong

11 Jun 2012, 3:37 PM
#6
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

Well, we've eliminated the text editor as the source of the problem.

How are you editing the header.php file? Is it a copy on your local hard drive that you edit, save, then FTP to the server? If so, then perhaps the settings in your FTP program are wrong.

As part of your editing do you copy and paste something from another program or file into header.php? If so, perhaps there are invisible characters coming in with the copy/pasted material.

Try taking a fresh copy of header.php, enter exactly one space character on a line that otherwise has nothing on it, then save the file. Then open it and delete that space character and save and FTP it to the server. Does your site go blank?

Rob

11 Jun 2012, 6:41 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting a blank page after editing header.php

Are you renaming the old file to another name but keeping the .php extension? If so, don't do that. Use something like ".bak" instead of ".php" for backup copies of files.

11 Jun 2012, 7:11 PM
#8
flowersbymalena avatar

flowersbymalena

New Zenner

Join Date:
May 2012
Posts:
13
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

I keep a separate backup of all the zc files in my pc ... I make a copy of the header.php file and edit the copy ... Then i upload the edited file .. Which is when the site turns white and unaccessible. I them restore the header.php file from my backup files ... Am i supposed to do something after i upload he update header.php file ... Or all i have to do is drop it in the right folder?

12 Jun 2012, 2:13 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting a blank page after editing header.php

Sounds like you're introducing a PHP error while you're doing your edits. That would cause the blank page.
Ref: http://www.zen-cart.com/content.php?124-blank-page

12 Jun 2012, 3:15 AM
#10
flowersbymalena avatar

flowersbymalena

New Zenner

Join Date:
May 2012
Posts:
13
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

@ drbyte .... thanks for the suggestions ... after reading what you suggested ... i realized that it was the syntax in the php file ... i added an apostrophe that i shouldn't have ... i was editing the define('HEADER_SALES_TEXT' line in the header file ... i needed it to say Don't just ... is there a way to add an apostrophe to this line in the header?

one more question ... i am trying to edit the text that appears on the top of the browser .... right now it says Abbington Mega ....

thanks a million ...

hector

12 Jun 2012, 3:19 AM
#11
flowersbymalena avatar

flowersbymalena

New Zenner

Join Date:
May 2012
Posts:
13
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

@ rstevenson ... thanks for the suggestions ... i tried everything that you suggested to realize that it was syntax error ... amazing how a 1.7 kb file can bring an entire site down to its knees ... thanks again

12 Jun 2012, 11:35 AM
#12
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Getting a blank page after editing header.php

flowersbymalena:

... i realized that it was the syntax in the php file ... i added an apostrophe that i shouldn't have ... i was editing the define('HEADER_SALES_TEXT' line in the header file ... i needed it to say Don't just ... is there a way to add an apostrophe to this line in the header?
The good Dr will know for sure, but I think you just need to use an HTML entity there. So instead of "Don't ..." you'd enter "Dont ...".

Rob

12 Jun 2012, 12:55 PM
#13
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Getting a blank page after editing header.php

or use don't

12 Jun 2012, 4:15 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting a blank page after editing header.php

Right.
Using entities works.
And escaping quotes is similarly appropriate.