0

I have a PHP program that makes a simulation of an aircraft motion (for technical studies). It requires quite a lot of input data. Therefore it would be advantageous to be able to save that data on the clients computer and recall it when used.
Of course there is a need to save many different cases and to choose from a list to recall, but that is another story.

My question:
How do I write to and read from a clients computer?

3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by Eriku
0

Save the client's ip (or session cookie id) on the server in the database when the entered information and the date.
When that computer visits the website again, you can poll the database and provide that data.

0

The database arrangement seems a little unpractical for this application (passwords, garbage collection etc).
But I suppose it is possible in PHP to make an arrangement where the client actively uploads from and downloads to a storage on his own computer (then the garbage is his own headache)?

0

Nope. Unless you use some brand-new browser capiabilities, or flash.
If it's just a bunch of fields, you can try to save it to a session cookie variable, or cookies, but beware that cookies are limited in size and are rather hard to manage.
You could just keep session cookies that link to the database, and the database entries can 'expire' on a cron job php script (just by checking the created_at date and seeing if it's so and so days afterwards).
You could also save it to a php disc session (look at php.net for instructions).
See http://www.developertutorials.com/tutorials/php/saving-php-session-data-database-050711/page1.html also...

0

Excuse me for beeing persistent; maybe I have not given enough information ...

The data has the shape of six files. They are very small, seen as computer files, but seen as figure tables to fill by hand, a couple of them could seem a bit scarey. You do not want to fill them in every time you want to repeat a simulation with some minor change ... or simulate a quite different case.
Is it really so that PHP does not provide a standard method for upload and download files?

0

Excuse me for beeing persistent; maybe I have not given enough information ...

The data has the shape of six files. They are very small, seen as computer files, but seen as figure tables to fill by hand, a couple of them could seem a bit scarey. You do not want to fill them in every time you want to repeat a simulation with some minor change ... or simulate a quite different case.
Is it really so that PHP does not provide a standard method for upload and download files?

If you want to save simulations for future use just use a damn database. Don't try to go against the grain when working with PHP. There are plenty of tools as your disposal for working with stuff like this. Instead of having the simulation parameters saved on the user's machine just have them saved in your database.

0

Thank you for your patience - I will consider your advice!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.