ASP Support

__z|x__

New Member
Messages
394
Reaction score
0
Points
0
__z|x__ said:
Sent Corey a PM. Lets see what he says.

Thanks guys!
It seems that he has only got 3 PM's till now. So, if you have not yet PM'ed him, please do.

Thanks.
 

Richard

Active Member
Messages
2,028
Reaction score
0
Points
36
Python 101

Koshimi said:

Just a couple of things. When using python cgi you need to import the cgi module also because you are working with web documents you need to tell what type of document header it needs to use.

So... The code will look as follows:
Code:
#!/usr/bin/env python

import cgi

print "Content-type: text/html"
print
print "Hello World"

Line 1: The shebang (#!/usr/bin/env python) - this line uses the env command some times python is not installed in /usr/bin. This command looks in several location for a python installation.

Line 3: Import the cgi module so that it can be use via the web.

Line 5 + 6: Here we tell the browser that the page is text and formated as html the secont print command seperates the header from the reast of the script. With out it the script fails.

Line 7: We print Hello World

Using python out side cgi-bin

If you want to use python files outside cgi-bin or use the .py file extention you need to goto Apache Handlers in cPanel can add .py (or any other extention) and cgi-script in the two boxes provided. This will allow you to execute cgi files anywhere on your site (BTW: .cgi is set by default).

For those in still think you can use ASP.net in linux http://www.mono-project.com/ASP.NET

PS (Koshimi): I added two extra files for you to look at. One lists the environment variables the other is a simple form.

PPS (Koshimi): Do you really want your username changed?
 
Last edited:

Richard

Active Member
Messages
2,028
Reaction score
0
Points
36
We are waiting for a couple more people to express interest.
 

jaygreentree

Member
Messages
148
Reaction score
1
Points
16
Like I have said in my other post about asp, its not true asp when installed on linux its a very heavily modified version and most ASP/ASP.NET scripts will not work on these servers if ASP is installed. Trust me I have tried on my Linux system its not the same.
 
Top