Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-16-2012, 05:28 PM   PM User | #1
sunilsagar
New to the CF scene

 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sunilsagar is an unknown quantity at this point
form data save in text file

Hi,

I want to save the form data (2 text box) in a text file (append) in one line on the server using html code.

After save, it display the two texts has been added to the file.

Need advice. thanks in advance.

Thanks
Sunil
sunilsagar is offline   Reply With Quote
Old 01-16-2012, 05:38 PM   PM User | #2
Alternative
New Coder

 
Join Date: Jan 2012
Location: RI, USA
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Alternative is an unknown quantity at this point
HTML alone cannot do this - you will need to use either PHP or Javascript. The fwrite function in PHP can help you acheive this.

PHP Code:
$file "formData.txt";
$handle fopen($formData'w') or die("Cannot open file - check write permissions!");
$formData $_POST['fieldThatHasTheData'];
fwrite($handle$formData);
fclose($handle); 
You would need a previous file that has the form data. I would certainly use post as the get method, although you could use get.
Alternative is offline   Reply With Quote
Old 01-17-2012, 09:15 AM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by Alternative View Post
HTML alone cannot do this - you will need to use either PHP or Javascript.

JavaScript can't do it either - you need a server side language such as PHP to do it.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Tags
html

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:51 PM.


Advertisement
Log in to turn off these ads.