944,076 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 555
  • PHP RSS
Oct 20th, 2009
0

Write to and read from clients computer

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Eriku is offline Offline
7 posts
since Oct 2009
Oct 20th, 2009
0
Re: Write to and read from clients computer
You can't, use a database. It's that simple.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Oct 20th, 2009
0
Re: Write to and read from clients computer
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.
Reputation Points: 18
Solved Threads: 21
Junior Poster
codejoust is offline Offline
180 posts
since Jul 2009
Oct 20th, 2009
0
Re: Write to and read from clients computer
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)?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Eriku is offline Offline
7 posts
since Oct 2009
Oct 20th, 2009
0
Re: Write to and read from clients computer
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/tu...711/page1.html also...
Reputation Points: 18
Solved Threads: 21
Junior Poster
codejoust is offline Offline
180 posts
since Jul 2009
Oct 20th, 2009
0
Re: Write to and read from clients computer
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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Eriku is offline Offline
7 posts
since Oct 2009
Oct 20th, 2009
0
Re: Write to and read from clients computer
Click to Expand / Collapse  Quote originally posted by Eriku ...
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.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Oct 21st, 2009
0
Re: Write to and read from clients computer
Thank you for your patience - I will consider your advice!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Eriku is offline Offline
7 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: problem with my_sql_db
Next Thread in PHP Forum Timeline: Need help with sending Bcc to emails fetched from database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC