How to display input on one web page on another?

Thread Starter


Joined Sep 7, 2009
I'd like to have a web page www example com/input.html with an input box.
Whatever gets typed into that input box I'd like to display on the page www example com/input.html (actually my computer will be sending to the input box but I'm pretty sure I can do that easily with Python).
A visitor to output.html shouldn't be able to find the location of input.html (or I could just put a password on input.html).

The problem is I don't know where to start looking or even what to search for. Any tips?
My host has the following available:
PHP5 with SOAP Support
Ruby Hosting

<ed> I should probably mention that although this could be done with FTP, my host has a system where to use FTP, you have to log in to their site and unlock it for a period. </ed>
Last edited:


Joined Sep 26, 2009
In order to do this, you have to find out if your host will allow you to run scripts on the server, you would have to have the input "post" data to the host server, which could then be retrieved ("get") by the output form (would be best if the output form just queried the server for data every now and then, basically set up a timer to update the form periodically, or when a user clicks a button to refresh)..... you can write these scripts in any of the server supported languages you posted above..... here is some light reading on the "post" and "Get" methods used for this type of stuff...

Thread Starter


Joined Sep 7, 2009
Finally managed it, still have to sort out a couple of things:
Whatever you put here:
You have to click back to input again.

should turn up here:

I might not leave the pages up for very long, if anyone spots any problems or security issues please let me know.
No typing rude things in the box!

Rich (BB code):

<form action="/cgi-bin/" method="post">
<input type="submit" value="Send Data" />
First name: <input type="text" name="first" />
  <br /> 
  <!-- form contents go here --> 

Rich (BB code):

<!--#exec cgi="/cgi-bin/" -->

</html> (for output)
Rich (BB code):

print "Content-type: text/html\n"

print """



Below text comes from file


file_in = open("test.txt", "r")
count = file_in.readline()     # it *is* a text file
print count     

print "</body>"
print "</html>"
Rich (BB code):

import cgi
form = cgi.FieldStorage() # instantiate only once!
name = form.getfirst('first', 'empty')

# Avoid script injection escaping the user input
name = cgi.escape(name)

print """\
Content-Type: text/html\n
<p>File should be updated to "%s"</p>

""" % name

file_out = open("test.txt", "w")


print "</body>"
print "</html>"


Joined May 1, 2009
Looks pretty good. I didnt see the code and went and tried some injections. They all failed. Then I saw the code and see you are scrubbing for it. Nice.

I don't see a length limit. someone could try to fill up your drive or crash the system by putting huge amounts of data into the post.

Thread Starter


Joined Sep 7, 2009
I think I probably should put a length check on it, someone just put 93kB of Lorem ipsum text on there. I had no idea you could paste that much into an input box. I'll probably give the input page an unguessable name anyway, with no links to it.
I'm going to take the input page down now.


Joined Jul 24, 2012
In my point of view Processing data from an HTML form can not be done with HTML.

You either need to use a server side scripting language (such as PHP), or a client side scripting language (such as Javascript).

In general it is better to use a server side scripting language because that will work for all visitors. Perhaps 10% of people have javascript turned off. Consequently javascript based form processing will not work for them.