duracellis Posted February 3, 2010 Share Posted February 3, 2010 I'm getting a funny error when I view my pages in a browser and I was just wondering if anyone could fill me in on what's happening. I'm sure it's obvious but i'm new to html/php. I'm using Apache 2.2.14 and php 5.2.12 Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/ Share on other sites More sharing options...
duracellis Posted February 3, 2010 Author Share Posted February 3, 2010 i suppose i should post the problem too... when it format this program <HTML> <HEAD> <TITLE> A Small Hello </TITLE> </HEAD> <BODY> <H1>Hi</H1> <P>This is very minimal "hello world" HTML document.</P> </BODY> </HTML> comes out like this {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 \par \par \par \par \par Hi \par This is very minimal "hello world" HTML document. \par \par \par } � Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006020 Share on other sites More sharing options...
jammesz Posted February 3, 2010 Share Posted February 3, 2010 this possibly might be your editors fault. Post the 'page source' code that your browser generates. Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006023 Share on other sites More sharing options...
duracellis Posted February 3, 2010 Author Share Posted February 3, 2010 {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 <HTML>\par <HEAD>\par <TITLE>\par A Small Hello\par </TITLE>\par </HEAD>\par <BODY>\par <H1>Hi</H1>\par <P>This is very minimal "hello world" HTML document.</P>\par </BODY>\par </HTML>\par } � Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006027 Share on other sites More sharing options...
jammesz Posted February 3, 2010 Share Posted February 3, 2010 the fact that it says generator Msftedit 5.41.15.1515 suggests that its your editors fault for this happening. What editor are you using? Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006035 Share on other sites More sharing options...
oni-kun Posted February 3, 2010 Share Posted February 3, 2010 Yes, Note scripting languages are meant to be written only on simple text editors, or PHP/code IDE's. I recommend NetBeans, Or if you want something simple with good syntax highlighting notepad++: http://notepad-plus.sourceforge.net/uk/site.htm If you use Microsoft Word, or save in any other format than plain text, then PHP will not be able to parse the metadata that is saved with it, and cannot display the page properly if at all, It seems you are saving in RTF (Rich Text Format) And not plaintext Also, you should place the following code at the top of your script (under the <?php tag) to display errors that normally would be suppressed: ini_set('display_errors',1); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006045 Share on other sites More sharing options...
duracellis Posted February 3, 2010 Author Share Posted February 3, 2010 just using wordpad which came with my windows xp Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006047 Share on other sites More sharing options...
duracellis Posted February 3, 2010 Author Share Posted February 3, 2010 you are correct. it is something with wordpad. i opened it up with notepad and it had a bunch of stuff at the top thanks for the fast replies Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006048 Share on other sites More sharing options...
oni-kun Posted February 3, 2010 Share Posted February 3, 2010 you are correct. it is something with wordpad. i opened it up with notepad and it had a bunch of stuff at the top thanks for the fast replies Wordpad is Microsoft's advanced version of notepad, so yeah, it may add unwanted metadata. But read my above post about error reporting, it's useful as it would tell you that in the first place.. Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006049 Share on other sites More sharing options...
scept1c Posted February 3, 2010 Share Posted February 3, 2010 thanks, had the same issue. is it due to character encoding? Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006059 Share on other sites More sharing options...
jammesz Posted February 3, 2010 Share Posted February 3, 2010 Notepad is ok but I would personally recommend notepad++ for editing on windows. You should try it Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006062 Share on other sites More sharing options...
gwolgamott Posted February 3, 2010 Share Posted February 3, 2010 I like LopeEdit thanks, had the same issue. is it due to character encoding? No it's just that there is a lot extra junk many editors add. Since it has extra features not pertaining to just editing text. First rule of programming in my book is learn to do it in notepad, li, or what-have-you first. A compiler for a programming language will not parse out all the junk (and shouldn't need to). Characters are still encoded with ASCII standards, just metadata is added to the file. Telling who the author is and date stamp... ect... fun stuff like that. Which a compiler will go... "WTF is that!?!?!? should I puke or should I just print it out." Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006063 Share on other sites More sharing options...
scept1c Posted February 3, 2010 Share Posted February 3, 2010 No it's just that there is a lot extra junk many editors add. Since it has extra features not pertaining to just editing text. First rule of programming in my book is learn to do it in notepad, li, or what-have-you first. A compiler for a programming language will not parse out all the junk (and shouldn't need to). Characters are still encoded with ASCII standards, just metadata is added to the file. Telling who the author is and date stamp... ect... fun stuff like that. Which a compiler will go... "WTF is that!?!?!? should I puke or should I just print it out." thanks for the full answer. Isn't it possible to remove that "extra" useless data added to the file? Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006065 Share on other sites More sharing options...
gwolgamott Posted February 3, 2010 Share Posted February 3, 2010 Yes it is possible, you just write a script to parse out the extra junk. Assuming you know what and where to look for. I've done it on a number of occasions... sometimes painfully... to allow someone to upload something they don't want to edit themselves. But generally when you can use notepad or a program that you can get relatively easy and free designed to edit text for code why bother in a programming sense. In the case that you are dealing with a document you need parsed, well there are a lot of techniques and discussions on that topic. EDIT: That is for a file being read in not the program itself... the compiler will still flip out. Otherwise open the file in notepad and just remove the stuff that is there that's not the actual text for the program. Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1006071 Share on other sites More sharing options...
scept1c Posted February 19, 2010 Share Posted February 19, 2010 thanks, I did a little progress on this, though it's harder and more time to spend, I like to understand each line I'm using. Quote Link to comment https://forums.phpfreaks.com/topic/190779-dumb-question/#findComment-1014807 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.