It is currently Wed Feb 08, 2012 5:21 pm

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Import Text File
PostPosted: Mon Oct 08, 2007 5:38 am 
Offline

Joined: Mon Oct 08, 2007 5:37 am
Posts: 1
Location: New Jersey
Hi. I am new to PHP development and I am working on a very small project right now that I thought would be the perfect place for me to dive in and learn. So far, so good but the question I have is about importing a .txt file. I have the file importing properly and the CSS is applying properly but what I want to know is how to have a single .txt but attach variables to certain lines to just pull data from that section. This is hard to describe so here is the link to the page that I am working on:

http://www.williamverbist.com/_ethno/ethnic_spring.php

The area I am referring to is the Title(s) and product description. Is there a way that all of that data can be in a single text file but by adding varibles or arrays to lines that when you click on one of the circles to see another product that the copy area will change as well? I work a lot in Flash and have done that there many times but was not sure if it is possible with just PHP or do I actually need to build a small MySQL database? Since there will not be a ton of data here, I was trying to keep this as simple as possible.

Any help would be appreciated. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 4:23 am 
Offline

Joined: Sun May 02, 2004 11:34 pm
Posts: 6500
Location: toronto, canada
That took a few rereads to make sense of what you really wanted. You are using the text file as the data source and you want to change the presentation based on something clicked on the client...

If that is correct, you can do something similar, but if you want the same user experience, you will need to use AJAX, otherwise you will need to reload the page each time.

You can simulate this by reading the file into an array, assuming that each line is the complete elements list of for one record. Then you can show the user some piece of that array as the item...when the user clicks the link, you do an AJAX call to the server, repeat the same page that you used to do the initial html, passing in the parameter of the element that you want. The parameter likely to the index element of the array that would hold the data.

_________________
Lostboy

Cat, the other other white meat

Please read Posting Etiquette before posting

You can always try Google


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: