Ok - I've spent enough hours searching that this warrents a "can it even be done" post...
I converted an Excel file, complete with formulas and self-calculating cells, into a web page using javascript. It's a personal budget and it allows me to change the value of certian cells and basically behave exactly the same way it does in Excel. The problem is saving the file.
I figured out how to save an updated version on the HTML file locally using persistence (
http://msdn.microsoft.com/library/de...esnapshot.asp). This successfully saves any changes I make in any of the input fields on the page, using the borwser's "Save As" function. The trick now is to get these changes to save on the server.
I've used this code in the past to save the output of a dynamically generated page:
PHP Code:
<?php
include 'start.php';
?>
The HTML...
PHP Code:
<?php
$page_source = ob_get_contents();
ob_end_flush();
$unique_id = date("y-m-d_g:i:sa",time());
$file = $unique_id.".php";
$fp = fopen ("$file", "wb");
$content = "$page_source";
fwrite($fp, $content);
fclose($fp);
?>
BUT...
a) I don't know how to call this script from a "Save" button, or something like that, and
b) Since I don't know how to do that, I don't even know if the file generated would include the updated input fields, or just the original HTML. (When I "View Source" on the page after updating input fields, the orignal HTML appears - if that helps... is that what the PHP script would see?)
If anyone can tell me if this is possible, either my way or another way, it would save me another 10 or so hours of Google-ing. (And if it is possible, does anyone know how to pass the updated HTML page through a PHP processor to save it on the server...?)
Thanks!
P.S. - As I mentioned, this for my own personal budget, so I'd don't want to link to the file I'm working on if someone can figure out what I'm talking about without it. If not, I'll make a non-sensitive version for everyone to see...