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

s1587

macrumors newbie
Original poster
Nov 16, 2007
14
0
Hi.
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?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
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?

-Lee
 

lucasgladding

macrumors 6502
Feb 16, 2007
319
1
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

Luke
 

Trajectory

macrumors 6502a
Nov 13, 2005
741
0
Earth
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?
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.