Re: Read file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've seen it done with some creative javascript. (i.e. caching to a tmp dir and accessing the txt file onChange.) But you cannot (REPEAT CANNOT) execute php on a client machine unless you load php and a web server onto that client machine. PHP is still a server side script.

And 10k cookies is out of the question. I imagine it would bring down your browser.

You are correct to be concerned about people bringing down 10k records each time. I suggest you re-think your database strategy so that you bring down a smaller subset. If done right, you can use Javascript and a hidden window to fetch records from the database and return them to the currently running page without refreshing the page. (It can be done. It's ugly and it's a bugger to maintain, but it can be done.)

Let me know how I may be of service,
=C=
* Cal Evans
* http://www.eicc.com
* We take care of your IT,
* So you can take care of your business.
*
* I think inside the sphere.


Ng Hwee Hwee wrote:
what about using cookies?

my problem is this: i have about 10,000 hotels records and each of them has
information about its location, its hotel code, its hotel tel, its country
code etc... i would like to load this into the clients computer so that when
they enter a hotel code, all the information will be reflected in the form
using onChange()... if 50 employees were to query the database always for
these 10,000 records, i'm afraid the server can't take the traffic and die..
so i was thinking of uploading a CSV file into my client's computer and then
have my scripts find the file and read the file for Javascript to process...
since the information in the file changes ususally only once a year, i don't
have to worry that they will have back-dated information..

i'm desperate for enlightenment! thanx!! :o)

blessings,
hwee


----- Original Message ----- From: "Michael Scappa" <mscappa@xxxxxxxxxxx> To: "'Ng Hwee Hwee'" <hhwee@xxxxxxxxxxx> Sent: Tuesday, November 18, 2003 10:01 AM Subject: RE: Read file



If you are publishing it on the web, it has to get to the server
eventually, so your answer is "no". There is really no way around it. If
the file is often used, pump it into a DB and search it that way, it'll
be much quicker.

-----Original Message-----
From: Ng Hwee Hwee [mailto:hhwee@xxxxxxxxxxx]
Sent: Monday, November 17, 2003 8:58 PM
To: php-db@xxxxxxxxxxxxx
Subject: Re:  Read file

the reason i don't want to read from the server is because i don't want
to
use up too much space and processing time on the server.. the file has
50,000 records of information..

is there another way other than uploading on the server side??

thanx!
hwee


----- Original Message ----- From: "Jason Wong" <php-db@xxxxxxxxxxxx> To: <php-db@xxxxxxxxxxxxx> Sent: Tuesday, November 18, 2003 9:54 AM Subject: Re: Read file



On Tuesday 18 November 2003 09:29, Ng Hwee Hwee wrote:


can anyone enlighten me on how i can use PHP to read the contents of

a file

from the client's machine?? for eg, the client has a CSV file in his
MyDocuments directory, how can I read the contents and publish them

on the

web?

You have to ask them to upload it to the server:


manual > Handling file uploads

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development

*


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux