Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Please, does anyone know the html code or java Script for this problem;
I want a code that reads and saves to another webpage, any input a user puts into a textbox.
i.e. assume i have a text box and a sumit button. i want the code to read what is in the textbox and save it in a file/folder online when the submit button is clicked.Macrosoft

I mean the code only reads and writes to a file, info from two textboxes which the user will have to fillin.
example, like if i want to compiling a guest book.
I want the code to write whtaever info is in the text boxes, to a file which already exists.Macrosoft

I'm just geting started w/ PHP, but I'm almost sure it would
lend itself well to your needs. Someone else with far better
experience will help you more, but I found this page, and
thought it might be what you're looking for, or at least a
good beginning:
http://www.htmlite.com/php041.php
After you collect the input from the textboxes, it should be
accessible as a variable that can be written to a text file on
your server.

Like this:
****
<head><title>Textboxes</title></head>
<body>
<form action="textboxes.php" method="post">
<input type="text" name="box1" />
<input type="text" name="box2" />
<input type="submit" name="submit" value="Submit" />
</form><?php
if(isset($_POST['submit'])){$textone = $_POST['box1'];
$texttwo = $_POST['box2'];
$entry = ("Box1:$textone\nBox2:$texttwo\n\n");
$fp = fopen("textboxes.txt", "a");
fputs($fp, $entry);
fclose($fp);
}
?></body>
****
(put your html start/close tags where the *'s are)A couple notes: this is bare bones at best, I'm a newbie (at best). Obviously you could add a lot more functionality. Work it, girl!
Also, though I don't know much about it, SECURITY is a MAJOR consideration. Research it deeply. Remember to set the permissions for the text file(see the last post). Create a blank text file, this example uses one called "textboxes.txt); upload it to the same directory you put your php file (this example, "textboxes.php") in, and have some fun! HIH

http://www.w3schools.com/php/php_fo...
Maybe the page above is actually what you're looking for,
which takes the submitted info and prints it to a different
HTML page?
Unless you've already left the planet and they have a better
solution there?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |