1

I have a web page that uses a Python cgi script to store requested information for later retrieval by me. As an example, the web page has a text box that asks "What is your name?" When the user inputs his name and hits the submit button, the web page calls the Python cgi script which writes the user's name to mytextfile.txt on the web site. The problem is that if anyone goes to www.mydomain.com/mytextfile.txt, they can see all of the information written to the text file. Is there a solution to this? Or am I using the wrong tool? Thanks for your time.

dave
  • 683
  • 1
  • 8
  • 17

2 Answers2

2

Definitely the wrong tool. Multiple times.

  1. Store the file outside of the document root.
  2. Store a key to the file in the user's session.
  3. Use a web framework.
  4. Use WSGI.
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

Store it outside the document root.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636