Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving to file

Status
Not open for further replies.

Thomas001

Programmer
Jun 24, 2004
29
US
Is there a way to bring up a "save as" dialog to save a certain set of variables? I also have a <textarea> that needs to be saved this way to.

Thanks ^_-
 
You would probabbly have to submit it to PHP and let it generate the headers to force the save as, is this the way you want to go?
 
Something liek this:

Click the save button in browser
and it saves the variables to a text document that u can select where it saves.
 
CODE FROM: kenrbnsn (TechnicalUser)

Code:
/* page 1 */
<form action="<? echo $_SERVER['PHP_SELF'] ?>" method="POST">
Filename:&nbsp;<input type=text name=filename>
Content: <textarea name=pageinfo></textarea>
<input type=submit name=submit value="Create File">
</form>

/* page 2 */
<?
 $filename = $_POST['filename'];
 $pageinfo = stripslashes($_POST['pageinfo']);
 $fp = fopen($filename,'w+'); /* open for write/append */
 fprintf($fp,$pageinfo);
 fclose($fp);
 echo "Thanks\n";
?>


I was browsing and I saw someone needing the same as I.. Thanks anyway o_O
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top