For some reason I cannot get my CGI Script to work with my Dreamweaver file. I feel like it may have something to do with where I'm saying things are located. For example, the company website that I am working on has its files located on another website. I assume there needs to be a cgi-bin folder where all the web files are located. I placed a cgi-bin folder there with python.exe, cgi.py, string,py and my python file, request.py.
This is part of the code for my form in Dreamweaver. I have highlighted the form action that I placed in the code so that it would be able to read the python file (or supposedly be able to read the file):
<table width="561" height="332" border="0" align="left">
<tr>
<td width="555" height="328" valign="top"><div align="center"><form action="cgi-bin/request.py" enctype="multipart/form-data">
<table width="453" border="0">
<tr>
<td width="447"><div align="left"><span
class="style37">Name: </span>
<input maxlength="40" name="name" />
<br />
<br />
<span
class="style37">Email: </span>
<input id="email" maxlength="100" size="40"
name="email" />
<br />
<br />
<span class="style37">Company:</span>
<input
id="company" maxlength="100" size="40" name="company" />
<br />
<br />
Part of my (simple) python file is as follows:
#!/usr/bin/python
print "Content-type: text/html\n\n"
import cgi
import string
def main():
form = cgi.FieldStorage()
print "<head><title>Request Information Sent</title></head>"
print "<body><h1 align = center>"
print "<p>Thank you for your interest in aapptec products. The information has been sent.</body>"
name = form.getvalue("name")
if name == "":
print "No name provided, please go back and provide a name."
else:
print "Hello," + str(name) + "."
print "<font size = '4' face = 'Arial'>"
print "<br>"
print "<br>"
email = form.getvalue("email")
if email != "":
print "Email: " + str(email) + "<br>"
else:
print "No email provided.<br>"
However, when I type something in the fields on the form and click submit, one of two things either pops up. First, it says that the page cannot be found (which obviously has something to do where things are located). Second, it says that I have used an invalid HTTP verb. The URL comes up to be: http://aapptec.com/cgi-bin/request.py?name=&email=&company=&phone=&Fax=&address=&City=&State=&Zip=&component-select=General&submit=Send+to+aapptec
Any help would be GREATLY appreciated!!!!! If there is anything else that you need to know to help me, then please let me know!! Thanks so much.