Dipankar
Dipankar

Reputation: 11

Generating an HTML page and save under a folder

I would like to make a form that once you insert data into the form, it will automatically create a html format of the data you entered in a html and save it in a folder! How do i go by doing this?

Upvotes: 1

Views: 432

Answers (2)

Berzemus
Berzemus

Reputation: 3658

You could simply place a wysiwyg html javascript editor (such as TinyMCE ) inside a form (textarea field), and store the output in a file with Php.

Some basic WIKI's do only that.

Upvotes: 0

Marc B
Marc B

Reputation: 360562

No idea what you mean by "html format of the data", but having PHP write a file is trivial:

$data = "your html format goes here";
$fh = fopen('the_file_you_want_to_write_to.html', 'wb') or die('unable to open file for output');
fwrite($fh, $data);
fclose($fh);

Or even more simplistically:

file_put_contents('the_file_you_want_to_write_to.html', $data);

Upvotes: 3

Related Questions