milov.nl

Interaction design • webdevelopment • web art • photography

milov.nl : forum : coding : 'Save input from form'

Save input from form Newbie, 040131 03:05
Hi,
I'm looking for a php-script that will save form entries in separate variables in a file on the server so that I can print it on another page. Example: I go to the form /input.php and type "Nice" in a text field. I then hit submit and go to the page /show.php. On that page it now says: "Nice".

Any idea where I can find something like this?
Or how to make a script that does this?
as13-2-8.han.s.bonet.se
Re: Save input from form User 4574, 040201 21:38
use $_GET['someVariable']; OR $_POST[someVariable'];
depending on the method you chose in your form
for example:

<form name"~~" action="/show.php" method="get/post">
<input type="text" name="someVariable">
</form>
 
then in /show.php put something like this:

echo ("Whatever You Want To Say \n");
echo ("The User Said: ".$_GET['someVariable']."\n");
//or if you used post as your method
echo ("The User Said: ".$_POST['someVariable']."\n");
 
GET will put the variable in the address bar
for example: www.whatever.com/file.php?someVariable=whatever

i think thats what you wanted
24.229.246.28.cmts.mtp.ptd.net
Re: Save input from form User 4574, 040201 21:39
i pretty much gave you the code ... you just gotta add the extra stuff like the submit buttons etc...
24.229.246.28.cmts.mtp.ptd.net
Re: Save input from form John Doe, 040421 00:37
This is the message text
167.207.128.101
Pages: 1