a basket, a textfile and a question?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

a basket, a textfile and a question?

Post by harrisonad »

Hi, I have been reading articles and tutorials about e-comerce scripts and they use either session or cookies, or combination of the two to store information about items added to cart.
Now, I am experimenting (or re-experimenting) on creating e-comerce site using textfiles.
Is this possible?
Is it advisable, or secured?
Thank you for any comment.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

don't see why it wouldn't be possible. I use a db for mine and tie it to sessions.

I have 2 tables (well actually lots more, but for the sake of this example, I'll just use 2).

one is my cart table which stores all of the user's information, and one is my item table that has the items put into the cart as well as the cart id from the other table.

I can add or remove items from the cart by simply inserting or deleting items from my items table.

the cart table has a field for the user id which ties to the session var I set for the user (this could easily be done with any other var type (form, url etc).

as for advisable, seems like too much work for not much gain for me.
secure? I'm not the security guru, maybe hit up Roja about that one but shooting from the hip, I'd think it'd be less secure than mysql or the like as you're writing to a text file...

8O
Post Reply