Download/Save Textarea

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
I have a php Script that creates forms and functions depending on what my customers click on in a form. The results are displayed in 2 or 3 text areas. I have been looking every where and i can not find a code to do the following properly.

I want to have a save button under each textarea that allows them to save it locally without saving it on my server.

I have no problem using php cookies or JS to accomplish this. If anyone could help it is greatly appreciated
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The results are displayed in 2 or 3 text areas.

I want to have a save button under each textarea that allows them to save it locally without saving it on my server.

'textareas' , as in textarea input boxes?

'save locally', as in save to their hard disk? Save it for the session?
 

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
Text areas as in <textarea cols=10 rows=5>Bla Bla Bla</textarea>

Locally I mean they click on the save button and they can save it to their desktop or other directory.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The form:

HTML:
<form name="form1" id="form1" action="testback.php" method="POST" target="_blank">
<textarea id="area" name="area" rows="5" cols="25">
Some stuff here to save add your text
</textarea>
<input type="submit" value="Save As" name="submit" id="submit">
</form>

testback.php (probably should use $_POST or $_GET, make sure it is set, etc).

PHP:
<?php

header( 'Content-disposition: attachment; filename=yourInfo.txt' );

$mess = $_REQUEST['area'] ;

echo $mess ;

?>

Haven't tested it on all browsers. I vaguely recall reading somewherethat there might be a samll issue with IE for Mac.
 

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
Im not worried it works in IE and FF for windows and that is about 98% of my viewers. If it does not work in others they will just have to copy and paste the code.

Thank you for all your help
 
Last edited:
Top