client vs server
Posted: Fri Nov 12, 2010 2:07 am
Hi,
Would be great to get some thoughts on a project I am currently working on. I am new to PHP.
I have clients that need to connect to MYSQL database to select products out of a table.
It has to be secured. I use PHP to login and check with every page loaded.
My question comes when client select products. As I see it there are a couple of options.
1. Load MYSQL table data when page loads, fill dropdownlists and then uses client side scripting to select and add to a list before posting order to server.
2. Dynamically load table using PHP and write selection to table.
What is best practice? When is it better to use client side opposed to server side scripting? To add to the mix I have to fill a second dropdownlist based on first selection. Also has to fill a HTML table while client is adding products, allowing client to edit selection before finally posting to MYSQL database. Basically a very simple shopping cart.
Thank you in advance
Would be great to get some thoughts on a project I am currently working on. I am new to PHP.
I have clients that need to connect to MYSQL database to select products out of a table.
It has to be secured. I use PHP to login and check with every page loaded.
My question comes when client select products. As I see it there are a couple of options.
1. Load MYSQL table data when page loads, fill dropdownlists and then uses client side scripting to select and add to a list before posting order to server.
2. Dynamically load table using PHP and write selection to table.
What is best practice? When is it better to use client side opposed to server side scripting? To add to the mix I have to fill a second dropdownlist based on first selection. Also has to fill a HTML table while client is adding products, allowing client to edit selection before finally posting to MYSQL database. Basically a very simple shopping cart.
Thank you in advance