Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dukeofism

macrumors member
Original poster
Jul 22, 2009
55
0
I have been making webpages for a while, though I am no pro. I recently got a new MBP and decided today to try making a web page (to try out some php that I started learning ~5minutes ago). I could not figure out how to add php to my pages created in iWeb (though i still love the program). I decided to go back to basics with just TextEdit (which is presume is the mac variant of 'notepad'). When i create my file in Text edit that looks as follows

-----
<html>
<body>
Hi
</body>
</html>
------

and save that file as firstpage.html . I get and error (atleast what i think to be an error) when I open the file "firstpage.html" with both safari and firefox. The un expected event is both safari and firefox displaying the file as:

------
<html>
<body>
Hi
</body>
</html>
------
and not:
-------
Hi
-------

Is there something I am missing here? or not doing correctly?
Thanks!

P.S.
-Sorry if I am posting this in the wrong forum. I thought this was a bit to "basic" to be posted in the forum for web design and development.
 
I bet you have your computer set to not display file extensions. So since you saved this text file through textedit, even though you named the file as whatever.html in reality the file name is whatever.html.txt but you aren't seeing the ".txt because you have your computer set to not display file extensions.

To fix the problem you can either change just the extension on this particular file, or you can set the computer to always display file extensions in the file names. (I recommend the latter method if you're not a really super basic computer user). Tell me which method you would like to do and I'll tell you how to do it.
 
I bet you have your computer set to not display file extensions. So since you saved this text file through textedit, even though you named the file as whatever.html in reality the file name is whatever.html.txt but you aren't seeing the ".txt because you have your computer set to not display file extensions.

To fix the problem you can either change just the extension on this particular file, or you can set the computer to always display file extensions in the file names. (I recommend the latter method if you're not a really super basic computer user). Tell me which method you would like to do and I'll tell you how to do it.
Thanks for the Info. I'd like to know how to have my computer to always display extensions
 
When I get info about the file, it says under "general" that it is an HTML document...

Shouldn't it in fact then, display it as a webpage...?
 
I just figured out how to get the file extensions always displayed-- through the finder preferences. My file is defintitely saved as a .html
 
Open the file in text edit, and make sure the format is set to plain text, and not to rich text. If it's a plain text file, and when all extensions showing the file name is whatever.html, try dragging and dropping the file onto the safari icon again (rather than opening the file through safari's menu bar > "open" command). And tell us if that works, or if it doesn't. If it doesn't, then upload the html file here to the forum so we can look at the file ourselves and tell you what the problem is with it.

EDIT, and there are some problems with your code that can be causing the problem. You didn't close the head. After <html> write <head> </head> (iirc. It's been a LONG time since I did web page editing)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.