[mod_python] POST/GET using PSP

Graham Dumpleton grahamd at dscpl.com.au
Tue Jul 18 18:41:19 EDT 2006


Lukasz Szybalski wrote ..
> Hello,
> I am trying to display folders using PSP
> <html>
> <%
> import os
> %>
> <%=os.getcwd()%>

Don't rely on os.getcwd() returning anything sensible, also don't
rely on being able to use os.chdir(). The general rule is that no
Apache handler should change the working directory or rely on
the current working directory being set to a particular value. This
is because if they did, they would all interfere with each other.
The problem is made much worse if a multithreaded Apache MPM
is being used as you can't even guarantee that if you change the
working directory at the start of a handler that it will stay that
way for the length of time the handler is executing.

Graham

> <%
> for i in os.listdir("/"):
> %><a href=""><%=i
> %></a>
> <br>
> 
> </html>
> 
> Now i would like it to change folder when clicked on one.
> so let say we want to go to /etc. The easies way i see it is to use
> POST. Add variable /etc to address on top and then read it in when
> page is refreshed.
> How do i append "/etc" (http://localhost/index.psp?/etc ???) to the
> address and how do i read in the variable "/etc" from address bar
> using PSP
> 
> Thank you
> Lucas
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python


More information about the Mod_python mailing list