View Full Version : HTML help

Aug 30, 2008, 09:11 AM
I wrote a simple html script using text editor. my apache server is up and running. I have given full permissions to my html file. I am still not able to run it. I dont get the desired result on my browser. I get the script itself. can someone please tell me how i go about just running html scripts?

Aug 30, 2008, 10:10 AM
If you used TextEdit, make sure your file is saved as a text only (not rich text) format.

Or better yet, download TextWrangler (http://www.barebones.com/products/textwrangler/), or another text editor and use that for html editing.

Aug 30, 2008, 10:23 AM
HTML is not a scripting language, it's just a text markup language. There are server-side scripting languages for dynamic HTML generation like PHP, mason, etc. This requires a special handler to be setup by filetype. There is also javascript, which is client-side only scripting. What exactly are you trying to do? What is the extension of your file?


Aug 30, 2008, 02:45 PM
Seconded for each of the previous replies, but there is an additional thing to know. If you are already using another scripting language like PHP here, the file is saved as plain text, and you are running apache with the required preprocessor, make sure you are accessing the page through http://localhost/ rather than opening the through File > Open in your browser. You need to be going through http: rather than file: for the results you want.

As another note, you would probably get more interest if the thread were in one of the web forums rather than Mac programming. This forum should really be used for Xcode and other non-web programming topics.

Best of luck


Aug 30, 2008, 02:50 PM
Is the script running locally or on a remote server?

What is the file extension for HTML page?

What does your DirectoryIndex setting in your httpd.conf file say?

Aug 30, 2008, 04:17 PM
You must provide more info: What "script" is it you are trying to run? A PERL script? Python? Ruby? JavaScript in an HTML page?

If you are seeing the text and not running the script you probably need to change the file name to be the proper extension instead of html. PERL would .pl, Python py and so on.