Jump to content

dumb question


duracellis

Recommended Posts

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 } �

 

Link to comment
Share on other sites

{\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

}

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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 :D

 

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..

Link to comment
Share on other sites

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."

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.