| Web Design and Hosting Creating sites, scripting, and hosting discussions. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Dec 16, 2006
Posts: 25
![]() |
Hi guys,
What I'm trying to achieve here is a web page that will query a csv file and display data from that file. From what I've seen the way forward is using PHP. After having trawled through Google I'm still unsure, I'm a newbie when it comes to php. Basically I want to enter the first entry of a row from the csv file (which will be a 3 letter code) into a text box, click a 'submit' button (or press <enter> ) and then I want the web page to display the data from that row in a table or something. Any help would be appreciated
|
| QUOTE Thanks | |
![]() Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
|
This can be done in any scripting or programing language. You need some programming skills to accomplish this. If you don't have any, then it is time to learn.
You would have page with the box to enter the value, pass that back to the server which would read one row at a time from your csv file, convert it, at least up the the first 'column' to plain text, and compare that to the entered value. If the value matches, convert the remaining line and pass the new table back, otherwise repeat with the next row. If multiple rows can have repeating key values, then you have to read the entire file and build up your table. You might find a library that can read in a CVS file and convert the columns to variables to make it easier to deal with. Often the scripting language maintainers have a page for libraries you can search through. CameraTime - Time lapse photography for novice and advanced users. When asking questions, post the version of your software. You'll receive better answers. Please post your results to the thread as it is good feedback.
|
| QUOTE Thanks | |
![]() Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,905
![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
|
PHP: fgetcsv - Manual PHP: print_r - Manual Also your post variables will be found in the $_POST array ---> Join the Mac-Forums Folding team: use 37954 as your team number.View Mac-Forums Folding team statistics (More Info) Don't forget to use the User Reputation System |
||||
| QUOTE Thanks | |||||
![]() Member Since: Jun 26, 2011
Posts: 1
![]() |
Here is one example to read CSV file using PHP. Hope this helps! |
| QUOTE Thanks | |
![]() Member Since: Dec 23, 2010
Location: Vilano Beach, FL
Posts: 109
![]() Mac Specs: MBP 13" 4/250/320M/2.4GHz, iPad 16GB, iPhone 4 16GB
|
If this CSV doesn't change much (or even if it does for that matter), you might think about moving it into a structured database.
Then running various queries/filters/sorts would be easier and faster, and you can use existing functions for easily handling your data. So you could either import it manually (in the case where it doesn't change [often]), or use a browse/upload control to select a local file, move it to the server, parse it, drop it into a DB. In terms of "how", that's probably a larger post than this MB supports ![]() Have fun! |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Importing CSV File into Address Problems! | oleviking | Switcher Hangout | 6 | 06-08-2008 06:39 AM |
| Archive and Install question | andrebnu | OS X - Operating System | 6 | 10-30-2007 09:16 PM |
| new MacBook: Turbotax can't open file | azed | Switcher Hangout | 2 | 09-11-2007 02:05 PM |
| JPEG file download via PHP on Mac(IE) | irobot | Web Design and Hosting | 1 | 03-09-2005 09:40 PM |
| Scripting a cron job to post data to a url via variable | lizardthefish | OS X - Development and Darwin | 4 | 02-14-2004 04:33 PM |
All times are GMT -4. The time now is 05:47 PM.
Powered by vBulletin