Search
Left Quote    Treat your password like your toothbrush. Don't let anybody else use it, and get a new one every six months.
- Clifford Stoll    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Comment script error message
  This user is offline  ScottDB
  Subject: "Comment script error message" Posted: @ 7:17 am on Jun 05 2011   
Member #: 1388
Rank: User - (2)
Since: 06/05/11
Posts: 2
From: United States

Hi, I just tried to upload the script that I found here at http://www.alls yntax.com/tutor ials/PHP/24/Bui lding-a-Comment s-Script/1.php. The tutorial is the best I have seen. However I am getting an error mesage when I submit a comment. The comment goes through ok but when it refreshes from the posting I am getting this in place of the submit box.

Warning: Cannot modify header information - headers already sent by (output started at /home/scott/pub lic_html/mysite /profile.php:45 ) in /home/scott/pub lic_html/mysite /profile.php on line 140

Also when I refresh again I am getting the same comments showing submited again so now there are two exactly the ame comments and the submit box is back to normal. Refresh again and the two comments are still there with the same exact date and time.

Edited at 07:29:12 am on 06/05/11


Best Regards, Scott
    Viewed: 6,495 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comment script error message" Posted: @ 4:03 pm on Jun 05 2011    

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

As your first line of code before anything else, put ob_start();

and you're good to go.




-bs0d | AllSyntax.com

    Viewed: 6,485 Times | Reply to This | To top
  This user is offline  ScottDB
  Subject: "re: Comment script error message" Posted: @ 5:31 am on Jun 06 2011    
Member #: 1388
Rank: User - (2)
Since: 06/05/11
Posts: 2
From: United States

Hi, Thanks for that. I wasn't sure what you meant and I used it at the beginning of the comment code. Didn't work so I put it at the beginning of the page. Working great now. Thanks. The next thing I need to do is to learn how to put all this into a functions file and just have the different scripts and html pulled up with code like $comment. Would like to put all this into a tpl template once I get it all working.

I am fairly new to php and sql but I am trying to attempt to create my own site from scratch by studying different scripts to perform the actions I want and using them. Learning a lot this way.

Can you tell me what ob_start(); does? I have never seen that one in anything else?



Edited at 05:40:30 am on 06/06/11


Best Regards, Scott

    Viewed: 6,474 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Comment script error message" Posted: @ 4:04 pm on Jun 06 2011    

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

Here you go. Php.net is great for info and help on any function.

PHP.net - Ob_Start




-bs0d | AllSyntax.com

    Viewed: 6,466 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