|
#1
|
|||
|
|||
|
My humblest apologize for a potentially lengthy and embarassing request. I work as a computer programmer, yet I have just recently taken an interest in running a website and playing with code online. I must admit, I am completely and utterly lost on several matters, one of which concerns Python CGI.
That is, I know what I want to be able to do- I want to be able to take user input via an HTML form, run it through a Python script, and output information on my website. I'd have thought it would be fairly simple- but after spending countless hours studying countless manuals online, I simply cannot get it to work. While I'd appreciate a complete tutorial to how I might do so, I'll try to sum up what I've managed to learn so far- and in all honesty, it isn't much. Furthermore, if someone instead knows how to handle such a request by explaining it in PERL, I do not imagine the two are overly different- I'll certainly make due. =) My "script" consists of the following, in python: Quote:
1) Saving it within a CGI-BIN as a .cgi, .py, .pyc 2) Making all the permissions I can via SMARTFTP 755 or 777. 3) Repeating steps in the SCGI-BIN. When my HTML form points to the script within the CGI-BIN, I receive the 500 Error. When my HTML form points to the script in the SCGI-BIN, I simply see my code written out again, rather than it running anything. I'm sure it is a newbie problem- but that doesn't mean you won't make me a dozens of others your willing worshippers if you assist. Thanks, Antistrategos |
|
#2
|
|||
|
|||
|
In retrospect, that is a silly script to post here. It's one of many I've tried- I'd be happy if I could just run a script that printed "Hello" at this point.
|
|
#3
|
||||
|
||||
|
Start with the perldigger script. Once you get that working, then move on to other scripts.
|
|
#4
|
|||
|
|||
|
I suppose it is only natural that your simple suggestion worked like a charm, and I am left with the expected feeling of embarassment. =)
Thank you for your quick response and assistance, I'm definitely impressed with Host Gator so far, and don't imagine I need look anywhere else for web hosting. I salute you! -Antistrategos. (Apologies for the spelling errors in the original post, I am quite used to having the ability to edit as soon as I submit.) |
|
#5
|
||||
|
||||
|
Don't worry, some times it take a guy who has sat there for HOURS working the same stupid problem to come up with the answer he found in the end.
The good news is that HG is converting to PHPSuExec, so Perl isn't as needed as it once was. |
|
#6
|
|||
|
|||
|
I had a similar problem not to long ago. You need to add an extra carriage return at the end of the script, preferably with a compatible editor. I upload my Python and Perl scripts then open them with the CPanel HTML editor to add the return.
Also make sure that your envelope is correct. HG's is a bit different from the standard so you may want to check with tech support. Quote:
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|