Reputation: 117
I just wanted to ask if it's possible to create a shopping cart with just php and javascript without using a database?
I've created one already, which is a bit unsecure because while adding the product to cart, I am fetching data (name and price) from labels so if someone edits them to cost 0, then it just adds it to cart on 0 cost.
So, is there any other way to create it with security, so that no one can edit it and get whole at cost 0?
Upvotes: 0
Views: 1551
Reputation: 88189
If what you men by no database is storing your data (eg. price client side) its definately a bad idea. If you use PHP arrays instead of a database it shuld work, but scalability might be an issue. Remember you still need to validate server side. Also you need to store customer purchase info somewhere. If theres no database, you could write to files. But you should really use a database. Is there some reason why you don't want to use a database?
Upvotes: 0
Reputation: 39872
This is a strange question, but your answer is no. You can't have an all client-side shopping cart and make it secure. You will need to validate all user submitted data server-side using PHP. This is good, solid programming practice for any website doing anything.
Upvotes: 3