// "Cтраница карнизов" *
else if ($Page == 'cornice') {
if (!$Module or $Page == 'cornice' and $Module == 'category' or $Page == 'cornice' and $Module == 'main' or $Module == 'podcategory') include('module/product/cornice/cornice.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/cornice/material_cornice.php');
else if ($Module == 'edit') include('module/product/cornice/edit_cornice.php');
}
// "Страница душевая программа" *
else if ($Page == 'shower') {
if (!$Module or $Page == 'shower' and $Module == 'category' or $Page == 'shower' and $Module == 'main' or $Module == 'podcategory') include('module/product/shower/shower.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/shower/materialshower.php');
else if ($Module == 'edit') include('module/product/shower/editshower.php');
}
else if ($Page == 'washes') {
if (!$Module or $Page == 'washes' and $Module == 'category' or $Page == 'washes' and $Module == 'main' or $Module == 'podcategory') include('module/product/washes/washes.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/washes/materialwashes.php');
else if ($Module == 'edit') include('module/product/washes/editwashes.php');
}
else if ($Page == 'bath') {
if (!$Module or $Page == 'bath' and $Module == 'category' or $Page == 'bath' and $Module == 'main' or $Module == 'podcategory') include('module/product/bath/bath.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/bath/materiabath.php');
else if ($Module == 'edit') include('module/product/bath/editbath.php');
}
else if ($Page == 'pencilcase') {
if (!$Module or $Page == 'pencilcase' and $Module == 'category' or $Page == 'pencilcase' and $Module == 'main' or $Module == 'podcategory') include('module/product/pencilcase/pencilcase.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/pencilcase/materialpencilcase.php');
else if ($Module == 'edit') include('module/product/pencilcase/editpencilcase.php');
}
else if ($Page == 'product2') {
if (!$Module or $Page == 'product2' and $Module == 'category' or $Page == 'product2' and $Module == 'main' or $Module == 'podcategory') include('module/product/smes/smes.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/smes/materialsmes.php');
else if ($Module == 'edit') include('module/product/smes/editsmes.php');
}
else if ($Page == 'accessories') {
if (!$Module or $Page == 'accessories' and $Module == 'category' or $Page == 'accessories' and $Module == 'main' or $Module == 'podcategory') include('module/product/accessories/accessories.php');
else if ($Module !== 'material' and $Module !== 'edit') {
header("HTTP/1.0 404 Not Found");
exit(include('page/404.php'));
}
else if ($Module == 'material') include('module/product/accessories/materialaccessories.php');
else if ($Module == 'edit') include('module/product/accessories/editaccessories.php');
}
Дальше можноне смотреть)// "Cтраница карнизов" *
А где код то? Че нам инклуды то показывать, где классы, где функции?
<?php
class Vegetable {
var $edible;
var $color;
function __construct($edible, $color="green")
{
$this->edible = $edible;
$this->color = $color;
}
function is_edible()
{
return $this->edible;
}
function what_color()
{
return $this->color;
}
}
class Spinach extends Vegetable {
var $cooked = false;
function __construct()
{
parent::__construct(true, "green");
}
function cook_it()
{
$this->cooked = true;
}
function is_cooked()
{
return $this->cooked;
}
}
?>
function Str_result($POST){
if (!isset($_SESSION['Ul_params'])) {
$_SESSION['Ul_params'] = 0;
} else {
if ($_POST['NameUP']) $_SESSION['Ul_params'] = 1;
else if ($_POST['NameDown']) $_SESSION['Ul_params'] = 2;
else if ($_POST['PriceUP']) $_SESSION['Ul_params'] = 3;
else if ($_POST['PriceDown']) $_SESSION['Ul_params'] = 4;
else if ($_POST['idUP']) $_SESSION['Ul_params'] = 0;
else if ($_POST['idDown']) $_SESSION['Ul_params'] = 5;
}
if($_SESSION['Ul_params'] == 0) return '`id` ASC';
else if($_SESSION['Ul_params'] == 0) return '`id` ASC';
else if($_SESSION['Ul_params'] == 1) return '`name` ASC';
else if($_SESSION['Ul_params'] == 2) return '`name` DESC';
else if($_SESSION['Ul_params'] == 3) return '`priceflo` ASC';
else if($_SESSION['Ul_params'] == 4) return '`priceflo` DESC';
else if($_SESSION['Ul_params'] == 5) return '`id` DESC';
}
Что-то пошло не такНапример ф-ия которая, кроме ошибок практически ничего не выдает. А в идеале должна была делать фильтрацию товара в зависимости от нажатой кнопки
PHP:function Str_result($POST){ if (!isset($_SESSION['Ul_params'])) { $_SESSION['Ul_params'] = 0; } else { if ($_POST['NameUP']) $_SESSION['Ul_params'] = 1; else if ($_POST['NameDown']) $_SESSION['Ul_params'] = 2; else if ($_POST['PriceUP']) $_SESSION['Ul_params'] = 3; else if ($_POST['PriceDown']) $_SESSION['Ul_params'] = 4; else if ($_POST['idUP']) $_SESSION['Ul_params'] = 0; else if ($_POST['idDown']) $_SESSION['Ul_params'] = 5; } if($_SESSION['Ul_params'] == 0) return '`id` ASC'; else if($_SESSION['Ul_params'] == 0) return '`id` ASC'; else if($_SESSION['Ul_params'] == 1) return '`name` ASC'; else if($_SESSION['Ul_params'] == 2) return '`name` DESC'; else if($_SESSION['Ul_params'] == 3) return '`priceflo` ASC'; else if($_SESSION['Ul_params'] == 4) return '`priceflo` DESC'; else if($_SESSION['Ul_params'] == 5) return '`id` DESC'; }
if($_SESSION['Ul_params'] == 0) return '`id` ASC';
else if($_SESSION['Ul_params'] == 0) return '`id` ASC';
Видали и похуже) В разы хужеНапример ф-ия которая, кроме ошибок практически ничего не выдает. А в идеале должна была делать фильтрацию товара в зависимости от нажатой кнопки
PHP:function Str_result($POST){ if (!isset($_SESSION['Ul_params'])) { $_SESSION['Ul_params'] = 0; } else { if ($_POST['NameUP']) $_SESSION['Ul_params'] = 1; else if ($_POST['NameDown']) $_SESSION['Ul_params'] = 2; else if ($_POST['PriceUP']) $_SESSION['Ul_params'] = 3; else if ($_POST['PriceDown']) $_SESSION['Ul_params'] = 4; else if ($_POST['idUP']) $_SESSION['Ul_params'] = 0; else if ($_POST['idDown']) $_SESSION['Ul_params'] = 5; } if($_SESSION['Ul_params'] == 0) return '`id` ASC'; else if($_SESSION['Ul_params'] == 0) return '`id` ASC'; else if($_SESSION['Ul_params'] == 1) return '`name` ASC'; else if($_SESSION['Ul_params'] == 2) return '`name` DESC'; else if($_SESSION['Ul_params'] == 3) return '`priceflo` ASC'; else if($_SESSION['Ul_params'] == 4) return '`priceflo` DESC'; else if($_SESSION['Ul_params'] == 5) return '`id` DESC'; }
В чём преймущество switch?Что-то пошло не так
Много, оч. много if и else if. Пора научится пользоваться switchКод:if($_SESSION['Ul_params'] == 0) return '`id` ASC'; else if($_SESSION['Ul_params'] == 0) return '`id` ASC';
Межсайтовый скриптинг, не?что такое xss ....
function PrepareGetList(
&$arIblockElementFields,
&$arJoinProps,
&$bOnlyCount,
&$bDistinct,
&$arSelectFields,
&$sSelect,
&$arAddSelectFields,
&$arFilter,
&$sWhere,
&$sSectionWhere,
&$arAddWhereFields,
&$arGroupBy,
&$sGroupBy,
&$arOrder,
&$arSqlOrder,
&$arAddOrderByFields,
&$arIBlockFilter,
&$arIBlockMultProps,
&$arIBlockConvProps,
&$arIBlockAllProps,
&$arIBlockNumProps,
&$arIBlockLongProps
)
{
это называется передача аргументов по ссылке.kick, я ничего не понял. Мне кажется вы забываете с кем общаетесь ...
<?php
$val = 6;
function test(&$val) {
$val *= 6;
}
echo $val; // выведет 6
test($val);
echo $val; // выведет 36
?>
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?