header error
header error
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
I am working on this script a whole afternoon
Every time i change the smallest text i get the following error
http://www.moshiachforkids.com/gbook/gbook.php?a=sign
Why?
All I did was change the text of the names of the feilds
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
I am working on this script a whole afternoon
Every time i change the smallest text i get the following error
http://www.moshiachforkids.com/gbook/gbook.php?a=sign
Why?
All I did was change the text of the names of the feilds
You have indeed edited something the wrong way.
The Gbook.php file is as the extension shows a php file. This is not a regular html file. A php file is parsed by your webserver before it is shown in the users browser. The code in the php file generates what is shown in the browser and what not.
When you edit a php file you should be aware of some things.
If you still want to edit the gbook.php file.
You should not delete or add <?php and ?> tags.
You should not delete or add echo ' and ';, however you can change code in between these tags. This code is shown in the browser.
You should not change variable names. And if you think you should change these names, you should change them in the whole php file (and if it is called from an external file like the $settings variables you should also change them in the external file).
To correctly change your gbook.php file. You should first undo your changes untill it works correctly again. Then change one line and see if it works. If it does not work you probably have used a faulty syntax and you should try to find the correct syntx. If it works okay change the next line and so on.
This is how I worked when I first started changing scripts.
Just to let you know for me it also takes a long time to change a script. The first php file I ever changed was gbook.php version 1.33 when I changed it to xhtml. Writing the valid html for it was easy. But the errors I got because i forgot or added a single quot or some other small typing error were many. By changing just one line at a time i could faster identify where the error was (it had to be in that one line i changed) and change it so the code would not generate an error.
I hope the help in the first part of this post helps a little with what you can change and should not change.
And my advice is to just keep trying untill you get the code right.
Greetings,
Henrie
The Gbook.php file is as the extension shows a php file. This is not a regular html file. A php file is parsed by your webserver before it is shown in the users browser. The code in the php file generates what is shown in the browser and what not.
When you edit a php file you should be aware of some things.
- php code starts with <?php and ends with ?>. What is not in between of these tags is handled as regular html.
- When php has to show something on the screen this is done with the this is done with the echo function. This is started with echo ' and ends with ';. Everything between these tags will be shown in the browser.
- When a variable that is used in the php code (variable can be recognised because they start with a $ character) needs to be shown in the echo function this is done by the following code '.$variableName.'
If you still want to edit the gbook.php file.
You should not delete or add <?php and ?> tags.
You should not delete or add echo ' and ';, however you can change code in between these tags. This code is shown in the browser.
You should not change variable names. And if you think you should change these names, you should change them in the whole php file (and if it is called from an external file like the $settings variables you should also change them in the external file).
To correctly change your gbook.php file. You should first undo your changes untill it works correctly again. Then change one line and see if it works. If it does not work you probably have used a faulty syntax and you should try to find the correct syntx. If it works okay change the next line and so on.
This is how I worked when I first started changing scripts.
Just to let you know for me it also takes a long time to change a script. The first php file I ever changed was gbook.php version 1.33 when I changed it to xhtml. Writing the valid html for it was easy. But the errors I got because i forgot or added a single quot or some other small typing error were many. By changing just one line at a time i could faster identify where the error was (it had to be in that one line i changed) and change it so the code would not generate an error.
I hope the help in the first part of this post helps a little with what you can change and should not change.
And my advice is to just keep trying untill you get the code right.
Greetings,
Henrie
header error
i understand
BUt
i unzipped the gbook.php file
if i upload it immediately it works
if i save it on my computer WITHOUT CHANGES
automatically i get the following errors
http://www.moshiachforkids.com/gbook/gbook.php?a=sign
i did not touch the script
BUt
i unzipped the gbook.php file
if i upload it immediately it works
if i save it on my computer WITHOUT CHANGES
automatically i get the following errors
http://www.moshiachforkids.com/gbook/gbook.php?a=sign
i did not touch the script
Hmm,
If the errors occur when you save the file without editing anything (open the file, save the file, close the file), i guess your editor does not save the file correctly.
But because you say you don't get any error when you upload the gbook.php file immediately this error probably has another cause.
Maybe you can zip an unedited but opened and saved gbook.php file (which than causes an error) and post a link in this forum. I can than download that file and see if causes an error here also and try to find what causes that file exactly.
And what file editor are you using?
Greetings, Henrie
What file editor are you using?BUt
i unzipped the gbook.php file
if i upload it immediately it works
if i save it on my computer WITHOUT CHANGES
automatically i get the following errors
If the errors occur when you save the file without editing anything (open the file, save the file, close the file), i guess your editor does not save the file correctly.
Normally I would say that is seems you have problems with the session cookies. Unfortunately i do not have enough knowledge of php sessions to help you with this.I see these errors, are these what you mean:Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 61
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 61
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot send session cookie - headers already sent by (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 67
Warning: Cannot modify header information - headers already sent by (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 876
Warning: Cannot modify header information - headers already sent by (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 877
Warning: Cannot modify header information - headers already sent by (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 878
Warning: Cannot modify header information - headers already sent by (output started at E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php:7) in E:\moshiachforkids.com\moshiachforkids.com\gbook\gbook.php on line 879
But because you say you don't get any error when you upload the gbook.php file immediately this error probably has another cause.
Maybe you can zip an unedited but opened and saved gbook.php file (which than causes an error) and post a link in this forum. I can than download that file and see if causes an error here also and try to find what causes that file exactly.
And what file editor are you using?
Greetings, Henrie
header error
thnaks alot
i will do that soon
i use front page
i will do that soon
i use front page
Hello Mirnot,
I just tested it and the GBook works fine for me, no errors.
But then again, I think this is the original GBook.php file, you did not open the gbook.php file and save it again (because the date is 2006-05-25). You also did not get an error with the original gbook.php file so this is no help.
I must remind you that this is version 1.41 and not 1.43 . Why are you not using the latest version?
I have opened it in Frontpage myself and saved it. It seems that Frontpage does not recognise the php extension and adds it's own header at the start of the page. This is what is causing the Warning: Cannot modify header information - headers already sent by (output started at /home/webmaster.volkel/WWW/moshiachforkids/gbook.php:12) in /home/webmaster.volkel/WWW/moshiachforkids/gbook.php on line 850 errors.
It did however not cause the Warning: session_start() [function.session-start]: Cannot send session cookie - error on my test.
Could you please update the zip file with a saved gbook.php file so i can see what is changed by your Frontpage.
You could also try an editor like PSPad http://www.pspad.com (this is what I am using). It has syntax highlighting for the code (but it is no wysiwyg editor). However it does not change php files by adding it's own code like Frontpage does.
Greetings,
Henrie
I just tested it and the GBook works fine for me, no errors.
But then again, I think this is the original GBook.php file, you did not open the gbook.php file and save it again (because the date is 2006-05-25). You also did not get an error with the original gbook.php file so this is no help.
I must remind you that this is version 1.41 and not 1.43 . Why are you not using the latest version?
I have opened it in Frontpage myself and saved it. It seems that Frontpage does not recognise the php extension and adds it's own header at the start of the page. This is what is causing the Warning: Cannot modify header information - headers already sent by (output started at /home/webmaster.volkel/WWW/moshiachforkids/gbook.php:12) in /home/webmaster.volkel/WWW/moshiachforkids/gbook.php on line 850 errors.
It did however not cause the Warning: session_start() [function.session-start]: Cannot send session cookie - error on my test.
Could you please update the zip file with a saved gbook.php file so i can see what is changed by your Frontpage.
You could also try an editor like PSPad http://www.pspad.com (this is what I am using). It has syntax highlighting for the code (but it is no wysiwyg editor). However it does not change php files by adding it's own code like Frontpage does.
Greetings,
Henrie
header error
Thanks for your help!!!
I have always used frontpage with gbook
could the problem be with the line
include_once 'header.txt';
echo '
here is the file
http://www.moshiachforkids.com/gbook/php.zip
I have always used frontpage with gbook
could the problem be with the line
include_once 'header.txt';
echo '
here is the file
http://www.moshiachforkids.com/gbook/php.zip
I downloaded the file and these are my findings.
The file should start with <?php like the default gbook.php, if not you will get lots of errors.
Put the headers back where they belong in this code and that is under the printTopHTML() function.
You now have the following code before the starting <?php tag:
Cut all this code and paste it so that the printTopHTML() function looks like this.
I previously explained that you should not add or delete <?php and ?> tags or echo ' and '; tags. With this I also meant that you should not place html code just anywhere. You can modify existing html by adding or deleting html code where it is already present, not introduce it where it previously was not present.
The
include_once 'header.txt';
echo '
code is certainly not to blame. You moving the head part was the problem.
If you keep editing the file with FrontPage, you should check the file everytime you save it afterwards by opening it in notepad (or PSPad). If Frontpage has added a header, you should delete it so that the <?php is the starting tag of the file again and than save the file. After you have done this, you can upload the file.
This is the only solution I can give you.
Succes with your page.
Greetings,
Henrie
The file should start with <?php like the default gbook.php, if not you will get lots of errors.
Put the headers back where they belong in this code and that is under the printTopHTML() function.
You now have the following code before the starting <?php tag:
Code: Select all
<html>
<head>
<title>'.$settings['gbook_title'].'</title>
<meta content="text/html; charset=windows-1250">
<link href="style.css" type="text/css" rel="stylesheet">
<script language="Javascript" type="text/javascript"><!--
function openSmiley() {
w=window.open("smileys.htm", "smileys", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=300,height=300");
if(!w.opener)
{
w.opener=self;
}
}
//-->
</script>
</head>
<body>
Code: Select all
function printTopHTML() {
global $settings;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>'.$settings['gbook_title'].'</title>
<meta content="text/html; charset=windows-1250">
<link href="style.css" type="text/css" rel="stylesheet">
<script language="Javascript" type="text/javascript"><!--
function openSmiley() {
w=window.open("smileys.htm", "smileys", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=300,height=300");
if(!w.opener)
{
w.opener=self;
}
}
//-->
</script>
</head>
<body>
';
include_once 'header.txt';
echo '
<div align="center">
<center>
';
} // END printTopHTML
The
include_once 'header.txt';
echo '
code is certainly not to blame. You moving the head part was the problem.
If you keep editing the file with FrontPage, you should check the file everytime you save it afterwards by opening it in notepad (or PSPad). If Frontpage has added a header, you should delete it so that the <?php is the starting tag of the file again and than save the file. After you have done this, you can upload the file.
This is the only solution I can give you.
Succes with your page.
Greetings,
Henrie
header error
is this the way itiis supposed to look
trust me i did not change the script it is way too complicated for me, to even try.
http://ww.moshiachforkids.com/gbook/php.zip
trust me i did not change the script it is way too complicated for me, to even try.
http://ww.moshiachforkids.com/gbook/php.zip
No!
In the file you posted you should change the following.
Find the next four lines (starting from the start of your file)and replace it with this
Then find the following code (starting at line 54 when you applied the first mentioned change)and delete it (you have pasted it at another place as i meant in my previous post).
Then find the following code (starting at line 865 when you have applied the previous two changes)and replace it with
Now it should work.
Greetings,
Henrie
In the file you posted you should change the following.
Find the next four lines (starting from the start of your file)
Code: Select all
<html>
<?php
Code: Select all
<?php
Code: Select all
global $settings; <BR>echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN"> <BR><html> <BR><head>
<BR><title>'.$settings['gbook_title'].'</title> <BR><meta
content="text/html; charset=windows-1250"> <BR><link href="style.css"
type="text/css" rel="stylesheet"> <BR><script language="Javascript"
type="text/javascript"><!-- <BR>function openSmiley() {
<BR>w=window.open("smileys.htm", "smileys",
"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=300,height=300");
<BR> if(!w.opener) <BR> { <BR> w.opener=self; <BR> } <BR>} <BR>//-->
<BR></script> <BR></head> <BR><body> <BR>'; <BR>include_once
'header.txt'; <BR>echo ' <BR> <BR><div align="center"> <BR><center>
<BR>'; <BR>
Then find the following code (starting at line 865 when you have applied the previous two changes)
Code: Select all
function printTopHTML() {
global $settings;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
</table>
';
include_once 'header.txt';
echo '
<div align="center">
<center>
';
} // END printTopHTML
Code: Select all
function printTopHTML() {
global $settings;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>'.$settings['gbook_title'].'</title>
<meta content="text/html; charset=windows-1250">
<link href="style.css" type="text/css" rel="stylesheet">
<script language="Javascript" type="text/javascript"><!--
function openSmiley() {
w=window.open("smileys.htm", "smileys", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=300,height=300");
if(!w.opener)
{
w.opener=self;
}
}
//-->
</script>
</head>
<body>
';
include_once 'header.txt';
echo '
<div align="center">
<center>
';
} // END printTopHTML
Greetings,
Henrie
header error
thank alot for your patience!!!
i did that
i still get this error
www.moshiachforkids.com/gbook/gbook.php
could this be the error
function printNoCache() {
header("Expires: Mon, 26 Jul 2000 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
} // END printNoCache
i did that
i still get this error
www.moshiachforkids.com/gbook/gbook.php
could this be the error
function printNoCache() {
header("Expires: Mon, 26 Jul 2000 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
} // END printNoCache
The problem is LINE 2 in your gbook.php file. You probably have some HTML code there, or perhaps the fisrt line in gbook.php is empty (or html)?
Paste the top 5 lines of your gbook.php here.
Or download gbook again and upload the original gbook.php file again. Don't touch a thing! If the original gbook.php had this problem then all people using it would see your error.
Paste the top 5 lines of your gbook.php here.
Or download gbook again and upload the original gbook.php file again. Don't touch a thing! If the original gbook.php had this problem then all people using it would see your error.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
header error
I GOT IT!!!
Even after i made the changes. It seems that Front Pge automatically puts the HTML on top, even if it looks good after you save the file.
Whenyou upload yoou find the HTML on top.
Since the only relevant HTML I needed was the style.css file i just posted it in the header file and it WORKED!
THANK YOU!
Even after i made the changes. It seems that Front Pge automatically puts the HTML on top, even if it looks good after you save the file.
Whenyou upload yoou find the HTML on top.
Since the only relevant HTML I needed was the style.css file i just posted it in the header file and it WORKED!
THANK YOU!
Yes, FrontPage is known to place a lot of unnecessary code into documents 

Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools