Write to and read from clients computer

Thread Solved

Join Date: Oct 2009
Posts: 7
Reputation: Eriku is an unknown quantity at this point 
Solved Threads: 0
Eriku Eriku is offline Offline
Newbie Poster

Write to and read from clients computer

 
0
  #1
Oct 20th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey
 
0
  #2
Oct 20th, 2009
You can't, use a database. It's that simple.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 18
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster
 
0
  #3
Oct 20th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 7
Reputation: Eriku is an unknown quantity at this point 
Solved Threads: 0
Eriku Eriku is offline Offline
Newbie Poster
 
0
  #4
Oct 20th, 2009
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)?
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 18
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster
 
0
  #5
Oct 20th, 2009
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...
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 7
Reputation: Eriku is an unknown quantity at this point 
Solved Threads: 0
Eriku Eriku is offline Offline
Newbie Poster
 
0
  #6
Oct 20th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey
 
0
  #7
Oct 20th, 2009
Originally Posted by Eriku View Post
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.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 7
Reputation: Eriku is an unknown quantity at this point 
Solved Threads: 0
Eriku Eriku is offline Offline
Newbie Poster
 
0
  #8
Oct 21st, 2009
Thank you for your patience - I will consider your advice!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC