CSS causing Premature end of script header error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
FlyingShoes12
Forum Newbie
Posts: 3
Joined: Sun Mar 07, 2010 4:28 pm

CSS causing Premature end of script header error

Post by FlyingShoes12 »

I am writing a CGI PHP script to handle a simple form. However, I am also using a CSS for the html-based output. I am getting the error:

Code: Select all

Premature end of script headers: SA.css, referer: http://192.168.1.15/cgi-bin/form.php
because of the line:

Code: Select all

<link rel="stylesheet" type="text/css" href="SA.css">
form.php is the script that is getting the error.

Thanks in advanced for any help.
Griven
Forum Contributor
Posts: 165
Joined: Sat May 09, 2009 8:23 pm

Re: CSS causing Premature end of script header error

Post by Griven »

Tags that do not have a corresponding end must include a slash at the end.

Code: Select all

<link rel="stylesheet" type="text/css" href="SA.css" />
Try that.
FlyingShoes12
Forum Newbie
Posts: 3
Joined: Sun Mar 07, 2010 4:28 pm

Re: CSS causing Premature end of script header error

Post by FlyingShoes12 »

Thanks but no go. I'm using HTML not XHTML, so I don't need to close ( I tried it anyway, but with no luck).
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: CSS causing Premature end of script header error

Post by Weirdan »

FlyingShoes12 wrote:I am writing a CGI PHP script to handle a simple form. However, I am also using a CSS for the html-based output. I am getting the error:

Code: Select all

Premature end of script headers: SA.css, referer: http://192.168.1.15/cgi-bin/form.php
because of the line:

Code: Select all

<link rel="stylesheet" type="text/css" href="SA.css">
form.php is the script that is getting the error.
Your server tries to run the css file like it was a cgi script. Move it out of the /cgi-bin/ folder, and make sure it's not executable (chmod a-x SA.css)
FlyingShoes12
Forum Newbie
Posts: 3
Joined: Sun Mar 07, 2010 4:28 pm

Re: CSS causing Premature end of script header error

Post by FlyingShoes12 »

Perfect it works thank you this has been driving me nuts.
Post Reply