Computing.Net > Forums > Web Development > How to create and save a page

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to create and save a page

Reply to Message Icon

Name: dijistanley
Date: October 31, 2007 at 09:25:04 Pacific
OS: Windows vista
CPU/Ram: 1 GB
Product: HP
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: robber2
Date: October 31, 2007 at 22:19:37 Pacific
Reply:

Works sweet using simple PHP.
http://devzone.zend.com/article/636...


0

Response Number 2
Name: dijistanley
Date: November 1, 2007 at 07:30:02 Pacific
Reply:

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


0

Response Number 3
Name: robber2
Date: November 1, 2007 at 09:36:32 Pacific
Reply:

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.


0

Response Number 4
Name: robber2
Date: November 1, 2007 at 12:35:59 Pacific
Reply:

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


0

Response Number 5
Name: robber2
Date: November 4, 2007 at 09:15:43 Pacific
Reply:

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?


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: How to create and save a page

How to create virtual try on www.computing.net/answers/webdevel/how-to-create-virtual-try-on-/3148.html

Rolling banner ad? How-to create? www.computing.net/answers/webdevel/rolling-banner-ad-howto-create/2503.html

how to store and retrieve data from www.computing.net/answers/webdevel/how-to-store-and-retrieve-data-from/3341.html