Jump to content

Recommended Posts

Posted

So I'm new to HelioHost and created a domain not long ago. I uploaded my own web page in a html file which works perfectly, but I also want to be able to execute a python script with cgi from it. I tried executing my Python script from the html page in my own local server and it works fine, but when I upload both the html and my python script (the latest on the cgi-bin folder) it doesn't work.

 

The code in the html is the next :

<form action="/cgi-bin/script.py" method"GET">

<fieldset>

<br>First seiyuu:<br>

<input type="text" name="name">

<br>Second seiyuu:<br>

<input type="text" name="name">

<br><input type="submit" value="Submit"><br>

</fieldset>

</form>

Pretty much I just execute my 'script.py' when you click the submit button.

 

And this is the code for my python script:

 

script.py

 

#!/usr/local/bin/python

 

print "Content-type: text/html"

print

print "<html>"

print '<body>'

print '<p> Hello World</p>'

print "</body>"

print "</html>"

 

When I click the submit button on my html page, I just get an Error 500. My index.html and all the files in the cgi-bin (including the folder itself) have the permissions set to 755 (All can be full executable).

 

Does anyone have any idea on what might be causing the error?

Thanks in advance

Posted

Use this:-

#!/usr/bin/python
print "Content-type: text/html"
print ""
print "<html>"
print "<body>"
print "<p> Hello World</p>"
print "</body>"
print "</html>"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...