HTML help

Discussion in 'Mac Programming' started by s1587, Aug 30, 2008.

  1. s1587 macrumors newbie

    Nov 16, 2007
    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?
  2. Mitthrawnuruodo Moderator emeritus


    Mar 10, 2004
    Bergen, Norway
    If you used TextEdit, make sure your file is saved as a text only (not rich text) format.

    Or better yet, download TextWrangler, or another text editor and use that for html editing.
  3. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    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?

  4. lucasgladding macrumors 6502

    Feb 16, 2007
    Waterloo, Ontario
    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

  5. Trajectory macrumors 6502a

    Nov 13, 2005
    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?
  6. Sayer macrumors 6502a


    Jan 4, 2002
    Austin, TX
    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.

Share This Page