govoridolgo.ru раздел красивые номера.Помогите вставить SQL скрипт в Hostcms
адрес ресурса, раздел красивые номера.
Валяться ошибки в основном: Замечание: Use of undefined constant s - assumed 's' в файле T:\home\192.168.1.2\www\hostcmsfiles\lib\lib_47\lib_47.php (строка 11) ит.д в таком же духе((( Самое главное если просто вставить в php файлик напрямую всё работает,а когда в hostcms не работает!!!
Валяться ошибки в основном: Замечание: Use of undefined constant s - assumed 's' в файле T:\home\192.168.1.2\www\hostcmsfiles\lib\lib_47\lib_47.php (строка 11) ит.д в таком же духе((( Самое главное если просто вставить в php файлик напрямую всё работает,а когда в hostcms не работает!!!
<?php
$pagelocation ="http://2255757.ru/numbers/numbers_3.php";
$file = file_get_contents($pagelocation);
$file = unserialize(base64_decode($file));
$name[1] = '<tr><td>Федеральных номеров нет</td></tr>';
$name[2] = '<tr><td>Прямых номеров нет</td></tr>';
$search = preg_replace("@[^0-9]+@i", '',$_REQUEST[s][0]);
if(is_array($file) && count($file) != 0)
foreach($file as $key => $_file):
$number = preg_replace("@[^0-9/-]+@i", '', $_file[0]);
$numberint = preg_replace("@[^0-9]+@i", '', $_file[0]);
$cost = $_file[1];
$tip_nomera = $_file[2];
$vostanovlenie = $_file[3];
$agentskie = $_file[4];
$_c[$cost] = $cost;
if($_REQUEST[s][1]!='' && $_REQUEST[s][2]!='' && $_REQUEST[s][1] <= $_REQUEST[s][2]):
if($cost >= $_REQUEST[s][1] && $cost <=$_REQUEST[s][2]):
$_cost[$cost] = $cost;
endif;
elseif($_REQUEST[s][1]!='' && $_REQUEST[s][2]==''):
if($cost >= $_REQUEST[s][1]):
$_cost[$cost] = $cost;
endif;
elseif($_REQUEST[s][1]=='' && $_REQUEST[s][2]!=''):
if($cost <= $_REQUEST[s][2]):
$_cost[$cost] = $cost;
endif;
else:
$_cost[$cost] = $cost;
endif;
if($search!=''):
if(strstr($numberint, $search)):
$print_number[$cost][$tip_nomera][] = '
<tr>
<td>
'.$number.'
</td>
<td>
'.$cost.' руб.
</td>
<td>
Код кнопки
</td>
</tr>
';
endif;
else:
$print_number[$cost][$tip_nomera][] = '
<tr>
<td>
'.$number.'
</td>
<td>
'.$cost.' руб.
</td>
<td>
Код кнопки
</td>
</tr>
';
endif;
endforeach;
if(is_array($_c)):
ksort($_c);
foreach($_c as $c):
$m[1][$c] = '<option value="'.$c.'" '.($_REQUEST['s'][1] == $c ? 'selected' : '').'>'.$c.'</option>';
$m[2][$c] = '<option value="'.$c.'" '.($_REQUEST['s'][2] == $c ? 'selected' : '').'>'.$c.'</option>';
endforeach;
endif;
if(is_array($_cost)):
ksort($_cost);
foreach($_cost as $c):
for($i='1';$i<3;$i++):
if(is_array($print_number[$c][$i])):
$print[$i][] = '
<tr>
<td colspan="3">
<strong>По '.$c.' руб.</strong>
</td>
</tr>
';
$print[$i][] = join("\n", $print_number[$c][$i]);
endif;
endfor;
endforeach;
endif;
$print_txt .= '
<div align="center">
<form method="post" enctype="multipart/form-data">
<table style="width:98%">
<tr>
<td align="center">
<b>Поиск:</b>
<input type="text" name="s[0]" value="'.$_REQUEST[s][0].'" style="width:200px;" />
<SELECT name="s[4]" style="WIDTH:120px">
<option value="">Все</option>
<option value="1" '.($_REQUEST[s][4] == '1'? 'selected' : '').'>Федеральные</option>
<option value="2" '.($_REQUEST[s][4] == '2'? 'selected' : '').'>Нрямые</option>
</SELECT>
</td>
</tr>
<tr>
<td align="center">
<b>По цене с: </b>
<SELECT name="s[1]" style="WIDTH:100px">
<option value="" ></option>
'.(is_array($m[1]) ? join("\n",$m[1]) :'').'
</SELECT>
<b> по </b>
<SELECT name="s[2]" style="WIDTH:100px">
<option value="" ></option>
'.(is_array($m[2]) ? join("\n",$m[2]) :'').'
</SELECT>
<input type="submit" name="push" value="Искать" />
</td>
</tr>
</table>
</form>
</div>
';
$print_txt .= '
<div align="center">
<table style="width:98%">
<tr>
<td valign="top" align="center">
';
if($_REQUEST[s][4] == '' || $_REQUEST[s][4] == '1')
$print_txt .= '
<table>
'.(is_array($print[1])?join("\n", $print[1]):$name[1]).'
</table>
';
$print_txt .= '
</td>
<td valign="top" align="center">
';
if($_REQUEST[s][4] == '' || $_REQUEST[s][4] == '2')
$print_txt .= '
<table>
'.(is_array($print[2])?join("\n", $print[2]):$name[2]).'
</table>
';
$print_txt .= '
</td>
</tr>
</table>
</div>
';
if(is_array($m))
print($print_txt);
$pagelocation ="http://2255757.ru/numbers/numbers_3.php";
$file = file_get_contents($pagelocation);
$file = unserialize(base64_decode($file));
$name[1] = '<tr><td>Федеральных номеров нет</td></tr>';
$name[2] = '<tr><td>Прямых номеров нет</td></tr>';
$search = preg_replace("@[^0-9]+@i", '',$_REQUEST[s][0]);
if(is_array($file) && count($file) != 0)
foreach($file as $key => $_file):
$number = preg_replace("@[^0-9/-]+@i", '', $_file[0]);
$numberint = preg_replace("@[^0-9]+@i", '', $_file[0]);
$cost = $_file[1];
$tip_nomera = $_file[2];
$vostanovlenie = $_file[3];
$agentskie = $_file[4];
$_c[$cost] = $cost;
if($_REQUEST[s][1]!='' && $_REQUEST[s][2]!='' && $_REQUEST[s][1] <= $_REQUEST[s][2]):
if($cost >= $_REQUEST[s][1] && $cost <=$_REQUEST[s][2]):
$_cost[$cost] = $cost;
endif;
elseif($_REQUEST[s][1]!='' && $_REQUEST[s][2]==''):
if($cost >= $_REQUEST[s][1]):
$_cost[$cost] = $cost;
endif;
elseif($_REQUEST[s][1]=='' && $_REQUEST[s][2]!=''):
if($cost <= $_REQUEST[s][2]):
$_cost[$cost] = $cost;
endif;
else:
$_cost[$cost] = $cost;
endif;
if($search!=''):
if(strstr($numberint, $search)):
$print_number[$cost][$tip_nomera][] = '
<tr>
<td>
'.$number.'
</td>
<td>
'.$cost.' руб.
</td>
<td>
Код кнопки
</td>
</tr>
';
endif;
else:
$print_number[$cost][$tip_nomera][] = '
<tr>
<td>
'.$number.'
</td>
<td>
'.$cost.' руб.
</td>
<td>
Код кнопки
</td>
</tr>
';
endif;
endforeach;
if(is_array($_c)):
ksort($_c);
foreach($_c as $c):
$m[1][$c] = '<option value="'.$c.'" '.($_REQUEST['s'][1] == $c ? 'selected' : '').'>'.$c.'</option>';
$m[2][$c] = '<option value="'.$c.'" '.($_REQUEST['s'][2] == $c ? 'selected' : '').'>'.$c.'</option>';
endforeach;
endif;
if(is_array($_cost)):
ksort($_cost);
foreach($_cost as $c):
for($i='1';$i<3;$i++):
if(is_array($print_number[$c][$i])):
$print[$i][] = '
<tr>
<td colspan="3">
<strong>По '.$c.' руб.</strong>
</td>
</tr>
';
$print[$i][] = join("\n", $print_number[$c][$i]);
endif;
endfor;
endforeach;
endif;
$print_txt .= '
<div align="center">
<form method="post" enctype="multipart/form-data">
<table style="width:98%">
<tr>
<td align="center">
<b>Поиск:</b>
<input type="text" name="s[0]" value="'.$_REQUEST[s][0].'" style="width:200px;" />
<SELECT name="s[4]" style="WIDTH:120px">
<option value="">Все</option>
<option value="1" '.($_REQUEST[s][4] == '1'? 'selected' : '').'>Федеральные</option>
<option value="2" '.($_REQUEST[s][4] == '2'? 'selected' : '').'>Нрямые</option>
</SELECT>
</td>
</tr>
<tr>
<td align="center">
<b>По цене с: </b>
<SELECT name="s[1]" style="WIDTH:100px">
<option value="" ></option>
'.(is_array($m[1]) ? join("\n",$m[1]) :'').'
</SELECT>
<b> по </b>
<SELECT name="s[2]" style="WIDTH:100px">
<option value="" ></option>
'.(is_array($m[2]) ? join("\n",$m[2]) :'').'
</SELECT>
<input type="submit" name="push" value="Искать" />
</td>
</tr>
</table>
</form>
</div>
';
$print_txt .= '
<div align="center">
<table style="width:98%">
<tr>
<td valign="top" align="center">
';
if($_REQUEST[s][4] == '' || $_REQUEST[s][4] == '1')
$print_txt .= '
<table>
'.(is_array($print[1])?join("\n", $print[1]):$name[1]).'
</table>
';
$print_txt .= '
</td>
<td valign="top" align="center">
';
if($_REQUEST[s][4] == '' || $_REQUEST[s][4] == '2')
$print_txt .= '
<table>
'.(is_array($print[2])?join("\n", $print[2]):$name[2]).'
</table>
';
$print_txt .= '
</td>
</tr>
</table>
</div>
';
if(is_array($m))
print($print_txt);
И правильно не работает, говнокод то отменный. В нем почти все переписать нужно. В отдельном файле оно работает только по тому, что отключен вывод ошибок и Вы просто их не видите, с HostCMS такое не пройдет.
HostCMS писал(а):
+1
говнокод то отменный
+1
Заказов не беру. Консультирую редко.
Авторизация