500 credits to fix my code

Status
Not open for further replies.

Scott B

New Member
Messages
844
Reaction score
0
Points
0
Hello everyone.
I have a guestbook script, but when I try to submit a message I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/scottbu1/public_html/gb.php:5) in /home/scottbu1/public_html/guestbook.php on line 41

I need someone to look at the code in the zip file I attached, and maybe try running this script on your own account. If you can fix the error I will give you 500 credits.
Thanks :)
 

Attachments

  • guestbook.zip
    5.6 KB · Views: 3

javajenius

New Member
Messages
258
Reaction score
0
Points
0
I think this might be the problem?
Code:
header('Location: ' . $_SERVER['REQUEST_URI']);

Read this and try to fix your own code
http://www.expertsrt.com/tutorials/Matt/HTTP_headers.html

To summarize, you cant send headers (which go at the head of the document) after already sending text. It has to be sent first. Read the linked page and find ways around this.
 

Scott B

New Member
Messages
844
Reaction score
0
Points
0
Oh well, I fixed it myself.
Thanks anyway.
*offer closed*
 
Status
Not open for further replies.
Top