One month ago I started (without zero knowledge) to learn HTML, PHP and MySQL to develop my webshop. For now I am able to create the MySQL db and producttables and produce the product overview on the product PHP pages. But now, after several hundreds of hours, reading dozens of manuals and hundreds of sample scripts, I am stuck, and can’t manage it on my own.
Following my most important problems:
On every product row, I have a “Add to basket” link. How can I manage to add a product to the “Shopping basket” page? Automatic total amount counting would be the next challenge for me I think. But…..one step at the time…..
Or is the solution something like this: When a visitor clicks an “Add” link, the product will be inserted to a (separate) table? So it takes two extra db actions. (1)Database total product overview – (2)Product selection insert into different db table – (3)Visitors choice selection overview from database.
To stick order x to visitor x, I have to make use of sessions, I understood. It seems to me that I have to start the session on my HTML product links page, and have to make sure that they maintain on the several product PHP pages. As far as I found out I can do this by calling a session_start followed by a session_register command on the HTML product page, and just use session_start on the other (PHP) pages. Am I correct? In all those manuals and sample scripts I saw this used with user/password logins. But I don’t want to bother visitors with this. Only on the last (order) page. But that’s a bit late to start a session I think…
Do I have to save such sessions in a db table? Or wil just the “start and register” command on the first page, and the “register” command on the other pages, be enough to maintain such a session during a browser session?
Some facts:
The server makes use of PHP version 4.1.0
Product table: article
Id INT(11) NOT NULL auto increment primary key
Name TEXT NOT NULL
Descr TEXT NOT NULL
Price FLOAT(5,2) NOT NULL Standaardwaarde 0.00
To give you an impression of what I have so far:
http://members.lycos.nl/iao/produkten.htm
Ok…thank you so much for reading this long ( I wanted to explain my ideas and problems very clearly to you) article. I hope there is somebody willing to help me to concquer these bottlenecks with some specific script-code/tips/tricks. Because of the length of this message I didn’t post the script I use. Please let me know if this is desired.
Thanks in advance,
Erik van Leeuwen