Search
Left Quote    Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Comments script
  This user is offline  scott
  Subject: "Comments script" Posted: @ 7:44 pm on Sep 30 2007   
Member #: 425
Rank: User - (2)
Since: 09/30/07
Posts: 2

Thank you for the comment script tutorial, i knew nothing before i started this morning, and now i have a basic idea and a comments section on my site.

One problem i am facing is when the form is submitted i get an error Warning: Cannot modify header information - headers already sent

I have read up on this and it appears i have to put the refresh code at the beginning of the page, however i want to have the script running at the bottom of the page like yours does.

How can i fix this?
Any help would be appreciated.

scott


    Viewed: 6,912 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comments script" Posted: @ 8:29 pm on Sep 30 2007    

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

yes, muliple times this topic has came up and to resolve this issue, place the code: ob_start( ); at the beginning of the script. This will prevent the errors.




-bs0d | AllSyntax.com

    Viewed: 6,907 Times | Reply to This | To top
  This user is offline  scott
  Subject: "re: Comments script" Posted: @ 9:41 pm on Sep 30 2007    
Member #: 425
Rank: User - (2)
Since: 09/30/07
Posts: 2

  bs0d said...

< i> yes, muliple times this topic has came up and to resolve this issue, place the code: ob_start( ); at the beginning of the script. This will prevent the errors.

Hey thanks for getting back to me,

i have added the piece of code like so
<?php
ob_start( );

$dbhost = 'localhost';< br /> $dbuser = 'web85-comment s-1';

however this has made no difference i'm still getting the header sent error, you made it sound so easy. what am i doing wrong?

scott




    Viewed: 6,903 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comments script" Posted: @ 3:33 am on Oct 01 2007    

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

Make sure its the very first line. If you're including the comments script in another page (quite likely), try using ob_start(); as the very 1st line of the main script.

For example, if you are including comments.php in your view.php page, use ob_start(); as the first line on view.php.




-bs0d | AllSyntax.com

    Viewed: 6,888 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-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank