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

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

How to create and save a page

Reply to Message Icon

Original Message
Name: dijistanley
Date: October 31, 2007 at 09:25:04 Pacific
Subject: How to create and save a page
OS: Windows vista
CPU/Ram: 1 GB
Model/Manufacturer: 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


Report Offensive Message For Removal


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

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


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal

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

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.


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal

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

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?


Report Offensive Follow Up For Removal







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








Do you have a Desktop Computer anymore?

No
Yes, but only at work
Yes, but its rarely used
Yes, and its a workhorse


View Results

Poll Finishes Today.
Discuss in The Lounge
Poll History




Data Recovery Software