-------------------------------- -------------------------------- -----index.php------------------ -------------------------------- ------------
PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- $sorting = $_GET["sort"];
- switch ($sorting) {
- case 'cost-asc':
- $sorting = 'cost ASC';
- break;
- case 'cost-desc':
- $sorting = 'cost DESC';
- break;
- case 'popular':
- $sorting = 'ord ASC';
- break;
- case 'news':
- $sorting = 'id DESC';
- break;
- case 'brand':
- $sorting = 'name ASC';
- break;
- default:
- $sorting= 'id ASC';
- break;
- }
- ?>