jmr3460 Posted May 31, 2009 Share Posted May 31, 2009 I am not sure but I am beginning to think that I have a text editor issue. I start a new page fresh and if I am trying to session_start() or set_cookie() I get header errors. The only way I can stop the errors is to trim() them. Does this mean that my editor is inserting white space or something. I am not really asking for a list of editors as much as is this possible. Well maybe I would like to know what some of you use (if this is appropriate to ask)? I am currently using UltraEdit v12. Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/ Share on other sites More sharing options...
anupamsaha Posted May 31, 2009 Share Posted May 31, 2009 I am not sure but I am beginning to think that I have a text editor issue. I start a new page fresh and if I am trying to session_start() or set_cookie() I get header errors. The only way I can stop the errors is to trim() them. Does this mean that my editor is inserting white space or something. I am not really asking for a list of editors as much as is this possible. Well maybe I would like to know what some of you use (if this is appropriate to ask)? I am currently using UltraEdit v12. You can do a test like this. Copy the code to "notepad" or any other plain text editor and save it as the "php" file. Run this file. If it is not showing any error, then surely, you are having an issue with the script editor that you are using. Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846309 Share on other sites More sharing options...
wildteen88 Posted May 31, 2009 Share Posted May 31, 2009 What do you mean you have to use trim() when you use header/set_cookie Post your code and any error messages you get. Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846310 Share on other sites More sharing options...
Ken2k7 Posted May 31, 2009 Share Posted May 31, 2009 It's setcookie. Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846312 Share on other sites More sharing options...
jmr3460 Posted May 31, 2009 Author Share Posted May 31, 2009 this is my code: <?php setcookie("TestCookie","dogs"); ?> This is my warning: Warning: Cannot modify header information - headers already sent by (output started at /home3/simplic5/public_html/php/index.php:1) in /home3/simplic5/public_html/php/index.php on line 2 What is wrong with this code? Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846343 Share on other sites More sharing options...
wildteen88 Posted May 31, 2009 Share Posted May 31, 2009 Make sure your editor is saving your file as ASCII encoding or as UTF8 without BOM Also make sure nothing is before your opening PHP tags (this includes spaces/newlines etc) Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846345 Share on other sites More sharing options...
jmr3460 Posted May 31, 2009 Author Share Posted May 31, 2009 I guess my text editor will only let me save as utf-8 BOM. This is the actual code of the warning when I view source code. is the <br /> from the browser or the PHP saved file? <br /> <b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home3/simplic5/public_html/php/index.php:1) in <b>/home3/simplic5/public_html/php/index.php</b> on line <b>2</b><br /> Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846350 Share on other sites More sharing options...
PFMaBiSmAd Posted May 31, 2009 Share Posted May 31, 2009 text editor Why not use a programming editor. There are many free editors specifically designed to write code that have built-in features that aid in writing code. Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846351 Share on other sites More sharing options...
anupamsaha Posted May 31, 2009 Share Posted May 31, 2009 I guess my text editor will only let me save as utf-8 BOM. This is the actual code of the warning when I view source code. is the <br /> from the browser or the PHP saved file? <br /> <b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home3/simplic5/public_html/php/index.php:1) in <b>/home3/simplic5/public_html/php/index.php</b> on line <b>2</b><br /> Try Eclipse with PDT. Free, lightweight and simply great. http://www.eclipse.org/pdt/downloads/ Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846352 Share on other sites More sharing options...
jmr3460 Posted May 31, 2009 Author Share Posted May 31, 2009 Problem solved on one machine. I upgraded my UltraEdit to v.15 and tried to set a cookie and it is set. I have 45 days with this trial version. It is a programming editor that I am very familiar with so unless I have any other problems I going to stay with this. Thanks for all the help freaks. Quote Link to comment https://forums.phpfreaks.com/topic/160372-solved-possible-text-editor-issues/#findComment-846410 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.