Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Error Message Help...
Old 04-23-2006, 11:33 AM PHP Error Message Help...
Novice Talker

Posts: 10
Location: Doncaster, UK
Trades: 0
I'm currently coding a news section for my site (I'm using it as an excuse to learn PHP). The majority of the site is working OK, its just when I edit the news and Submit it, the following error message comes up.
Code:
Warning: Cannot modify header information - headers already sent by (output started at .../php/edit.php:1) in ..../php/edit.php on line 19
Invalid entry ID.
Here is the section of 'offending' code.

PHP Code:
 $id htmlspecialchars(strip_tags($_POST['id']));
    
$month htmlspecialchars(strip_tags($_POST['month']));
    
$date htmlspecialchars(strip_tags($_POST['date']));
    
$year htmlspecialchars(strip_tags($_POST['year']));
    
$time htmlspecialchars(strip_tags($_POST['time']));
    
$summary htmlspecialchars(strip_tags($_POST['summary']));
    
$entry htmlspecialchars(strip_tags($_POST['entry']));
    
$title htmlspecialchars(strip_tags($_POST['title']));

    
$timestamp strtotime ($month " " $date " " $year " " $time);

    
$result mysql_query("UPDATE php_news SET timestamp='$timestamp', title='$title', summary='$summary', entry='$entry' WHERE id='$id' LIMIT 1") or print ("Can't update entry.<br />" $sql "<br />" mysql_error());

//--->line19  
header("Location: news.php?id=" $id);
    

robterrace is offline
Reply With Quote
View Public Profile Visit robterrace's homepage!
 
 
Register now for full access!
Old 04-23-2006, 01:28 PM Re: PHP Error Message Help...
cdwhalley.com's Avatar
Skilled Talker

Posts: 75
Trades: 0
Make sure nothing has already been sent to the browser - any echo's, print's, or even just a space before the first <?php tag.
cdwhalley.com is offline
Reply With Quote
View Public Profile Visit cdwhalley.com's homepage!
 
Old 04-24-2006, 06:50 AM Re: PHP Error Message Help...
Novice Talker

Posts: 10
Location: Doncaster, UK
Trades: 0
Thanks for that, its worked a treat.
robterrace is offline
Reply With Quote
View Public Profile Visit robterrace's homepage!
 
Reply     « Reply to PHP Error Message Help...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12245 seconds with 12 queries