Separating design from code

  • Thread starter Íéêüëáïò Êïýñáò
  • Start date

Íéêüëáïò Êïýñáò

Hello, in this page at the bottom
end i decided to create a textarea for the user to enter some comments
related to the page that i want to submit to a mysql database table.

Now i have seperated the design from the code: is the design is the python script

Every request to any html page due to mod rewrite is passed to the
above python script.

Its my first time tryign to do this so i need to ask:

a) When the user hits submit after entering comments in the

<form method="post" action="">
<textarea name="comments" cols="40" rows="5">
Ó÷ïëéÜóôå Þ ñùôÞóôå ìå ó÷åôéêÜ....
<input type="submit" value="ÑùôÞóôå" />

What should the action be? The file itself or to the python code
As i have it now i am getting an error
Just try to enter something and hit sumbit you will see an error page.

#relevant code
# get some enviromental values
form = cgi.FieldStorage()
page = form.getvalue('page')

# try to open the page
f = open( '../' + page )

Why when the user submits the form error is created?

I need help passing an html form to my python script.

Please ask me if i need to provide more information about anything.

the mod rewrite rule is:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^/?(.+\.html) /cgi-bin/$1 [L,PT,QSA]

so for every html request to be handled by script

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Latest member

Latest Threads