Search
Left Quote    Every day I get up and look through the Forbes list of the richest people in America. If I
- Robert Orben    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Comments script
  This user is offline  sm0ke
  Subject: "Comments script" Posted: @ 11:18 am on Jun 05 2006   

Member #: 168
Rank: User - (83)
Since: 06/05/06
Posts: 34
From: Manchester - UK

Hi


I have followed the comments script tutorial by bs0d. Excellent tutorial and script, I have it working with just one problem.

Upon entering a new comment i receive the error, header output already started on line 58.

the line which refreshes the page and displays the newly added comment. I have added ob_start; to the top of the script and ob_end; to the end of the script, even trying without ob_end; does not allow the page to refresh correctly.

The comments are added to the database with the correct comlink which i have predefined to call eachj seperate articles coments (it has no association with the comms script apart from the page id, where my comlink id is different for each article, it works perfectly using any unique variables in the link to the comment script)

Any ideas on how to combat this problem?

Cheers sm0ke


Just because I dont care, doesnt mean I dont understand.
purepcs@hotmail
.co.uk |     Viewed: 8,122 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comments script" Posted: @ 11:46 am on Jun 05 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

well, did you try: ob_start; or ob_start();< /b> ?




-bs0d | AllSyntax.com

    Viewed: 8,117 Times | Reply to This | To top
  This user is offline  sm0ke
  Subject: "re: Comments script" Posted: @ 2:20 pm on Jun 05 2006    

Member #: 168
Rank: User - (83)
Since: 06/05/06
Posts: 34
From: Manchester - UK

Yes i have tried that.

I have detailed above I tried ob_start(); on its own at the top of the script.

I also added ob_end_flush(); (not ob_end(); as above) to see if that worked, again no joy.

i have tried ob_start(); on its own at the top of the file.

Thanks




Just because I dont care, doesnt mean I dont understand.

purepcs@hotmail
.co.uk |     Viewed: 8,112 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comments script" Posted: @ 4:38 pm on Jun 05 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

if you're including the comments script in another file, try putting the ob_start(); at the top of the file that you are including the comments script.




-bs0d | AllSyntax.com

    Viewed: 8,105 Times | Reply to This | To top
  This user is offline  sm0ke
  Subject: "re: Comments script" Posted: @ 3:24 pm on Jun 06 2006    

Member #: 168
Rank: User - (83)
Since: 06/05/06
Posts: 34
From: Manchester - UK

Sorted it now.

It was due to my text editor not presenting the line of whitespace at the very top of the file.

removed tis and all was ok. However in IE when a comment was added the script refreshed to a new comments page asking users to add a comment, be the first one. I combated this by removing the "#comment " identifier from the header location refresh command, and all works fine in IE and firefox.

Thanks




Just because I dont care, doesnt mean I dont understand.

purepcs@hotmail
.co.uk |     Viewed: 8,097 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comments script" Posted: @ 5:10 pm on Jun 06 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Cool deal! Glad you got it to work




-bs0d | AllSyntax.com

    Viewed: 8,093 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2017; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank