when i hit enter, i get this error Warning: Cannot modify header information - headers already sent by (output started at /home/koddinn/public_html/prufa/bok/guest_book.php:7) in /home/koddinn/public_html/prufa/bok/guest_book.php on line 66
Line 66 [size=2]header(“location: $bodyname”);[/size]
[size=2]maybe not big problem, any1 help me [/size]
Somewhere in your PHP file some HTML is sent to the browser. When that happens the headers get sent out. And then you try to modify the headers in line 66 but you can’t, because they’re already sent.
It could be something as simple as a blank before your opening PHP tag in the file. Make sure that the very first characters in the script are ‘<?php’ (without the quotes).
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?php
// A Simple PHP Guestbook (runs on flat-files)
// Complete, with simple error checking
$formData = '<form action="#" method="post"><input type="text" name="userName" value="Name"><input type="text" name="userMail" value="Email or URL"><textarea name="userComments">Comments</textarea><button type="submit" name="submit">Submit</button></form>';
if (($userName != "") || ($userName != " ")) { // The only error checking feature included...
$gbFile = fopen("guestbook.txt", "a");
fputs($gbFile, "<b>Name:</b> $userName <br><b>Email/URL:</b> $userMail <br><b>Comments:</b> $userComments <br><hr>");
}
include "guestbook.txt";
print $formData;
?>
</body>
</html>
i have got it to work, but i like to have those forms in it, but i mess it up always, see image
can someone help me with this, adding these forms in**.**