Купил скрипт и расстроился - все время ругаемся... Уже отчаялся найти решение, так как продавец оставил без поддержки. В PHP я не очень силен и очень много трудностей создают эти ошибки... Начну по порядку с самой объемной, по кол-ву строк, ошибки:
PHP Notice: Undefined offset: 7 on line 121
PHP Notice: Undefined offset: 8 on line 121
PHP Notice: Undefined offset: 18 on line 121
PHP Notice: Undefined offset: 49 on line 121
PHP Notice: Undefined offset: 7 on line 121
PHP Notice: Undefined offset: 8 on line 121
PHP Notice: Undefined offset: 18 on line 121
PHP Notice: Undefined offset: 45 on line 121
PHP Notice: Undefined offset: 42 on line 121
PHP Notice: Undefined offset: 46 on line 121
PHP Notice: Undefined offset: 43 on line 121
PHP Notice: Undefined offset: 41 on line 121
PHP Notice: Undefined offset: 44 on line 121
PHP Notice: Undefined offset: 47 on line 121
PHP Notice: Undefined offset: 48 on line 121
PHP Notice: Undefined offset: 49 on line 121
PHP Notice: Undefined offset: 50 on line 121
PHP Notice: Undefined offset: 51 on line 121
PHP Notice: Undefined offset: 52 on line 121
PHP Notice: Undefined offset: 53 on line 121
PHP Notice: Undefined offset: 54 on line 121
И собственно сама эта строчка:
$current = (!is_array($fields_value[$v['id']])) ? false : current($fields_value[$v['id']]);
Далее другая ошибка:
PHP Notice: Undefined index: HTTPS on line 78
Строчка, вызвавшая ошибку:
$settings['http']=($_SERVER['HTTPS']!= "")?'https':'http';
Далее следующая проблема:
PHP Notice: Undefined variable: rates_default on line 225
Ругаемся на это(225 строчка выделена):
require_once(COREPATH .'fields.php');
$smarty->assign('rates',$rates);
$smarty->assign('rates_default',$rates_default); /* это 225 строка */
timepointer('fields');
$title_normal=array();
И та же ошибка, но в другом файле:
PHP Notice: Undefined variable: rates_default on line 181
Ну и собственно та самая строчка:
$value = array('num' => $current, 'txt' => om_number($current, $rates_default['text']));
По вопросам трудящихся, добавляю полные скрипты. Undefined offset и Undefined variable тут:
<?php
$messages = array();
if(!isset($_COOKIE['notes'])){$_COOKIE['notes'] = "";}
$notes = explode_string($_COOKIE['notes'], ',');
if(isset($custom_sql)){
$sqlcachecheck = md5($custom_sql);
}else{
$sqlcachecheck = md5($dop_sql);
}
$settings['cache_query'] = (isset($settings['cache_query'])) ? $settings['cache_query'] : false;
if($settings['cache_query'] == 1){
$sqlcache = cache_get('q_'.$sqlcachecheck);
}else{
$sqlcache = false;
}
if($sqlcache){
extract($sqlcache);
}else{
if(isset($custom_sql)){
$res = dbquery($custom_sql);
}else{
$res = dbquery("SELECT * FROM ".PREF."db ".$dop_sql);
}
$i = 0;
$additional_text = '';
$additional_description = array();
//upd собираем список идентификаторов пользователей
$users_id = array();
while($data = dbarray($res))
{
$messages[$i] = $data;
$messages[$i]['link'] = $data['id'].'-'.cpu($data['title'], $locale['symb']).'.html';
$messages[$i]['fields'] = false;
$messages[$i]['text'] = stripslashes($data['text']);
$messages[$i]['title'] = stripslashes($data['title']);
$messages_id[] = $data['id'];
$fields_value = array();
$res1 = dbquery("SELECT * FROM ".PREF."db_fields WHERE message=".$data['id']);
while($dat1 = dbarray($res1)){
$fields_value[$dat1['field']][$dat1['id']] = $dat1['value'];
}
$mtags = array();
$res1 = dbquery("
SELECT ".PREF."tags.id, ".PREF."tags.word FROM ".PREF."tags
JOIN ".PREF."db_tags ON ".PREF."db_tags.tag = ".PREF."tags.id
WHERE ".PREF."db_tags.message=".$data['id']);
while($dat1 = dbarray($res1)){
$additional_text .= $dat1['word'].' ';
$mtags[] = $dat1;
}
if($messages[$i]['date_del'] < $settings['time'])
{
$messages[$i]['date_del'] = $settings['time'];
}
if(in_array($data['id'], $notes))
{
$messages[$i]['fav'] = 2;
$messages[$i]['fav_block'] = 'block';
}
else
{
$messages[$i]['fav'] = 1;
$messages[$i]['fav_block'] = 'none';
}
if(is_numeric($data['user_id']) && $data['user_id'] != 0)
{
$res2 = dbquery("SELECT * FROM ".PREF."users WHERE id = ".$data['user_id']." ");
$user = dbarray($res2);
if(!$user)
{
continue(1);
}
else
{
//upd
$users_id[] = $user['id'];
$messages[$i]['user_id_name'] = $user['name'];
$messages[$i]['user_array'] = $user;
}
}
foreach($fields as $k => $v)
{
$current = (!is_array($fields_value[$v['id']])) ? false : current($fields_value[$v['id']]); /* РУГАЕМСЯ НА ЭТО */
if($current !== false)
{
$array = array();
if($v['type'] == 's' || $v['type'] == 'r')
{
$values = explode_string($v['values']);
$value = trim($values[$current]);
$additional_text .= $value.' ';
$link = $current;
}
elseif($v['type'] == 'v')
{
$value = stripslashes($current);
$additional_text .= $value.' ';
//$link = urlencode($value) ;
}
elseif($v['type'] == 't')
{
$value = stripslashes($current);
$link = false;
}
elseif($v['type'] == 'c')
{
$values = explode_string($v['values']);
$value2 = $fields_value[$v['id']];
$value = array();
if(count($value2) > 0)
{
foreach($value2 as $_val)
{
$value[] = array('name' => $values[$_val], 'key' => stripslashes($_val));
$additional_text .= $values[$_val].' ';
}
}
$link = false;
}
elseif($v['type'] == 'i')
{
$value = stripslashes($current);
$link = false;
}
elseif($v['type'] == 'f')
{
$value = stripslashes($current);
$ext = get_ext($value);
$ext = $settings['patch'].'images/ico/'.get_ico($ext);
$value = array('filename' => $value, 'ico' => $ext);
$link = false;
}
elseif($v['type'] == 'y' || $v['type'] == 'j')
{
$value = $current;
$link = false;
}
elseif($v['type'] == 'p')
{
$value = array('num' => $current, 'txt' => om_number($current, $rates_default['text'])); /* РУГАЕМСЯ НА ЭТО */
}
$array = array('field_type' => $v['type'], 'field_value' => $link, 'field_name' => $k, 'name' => $v['name'], 'value' => $value, 'string_type' => $v['type_string'], 'hide' => $v['hide']);
$messages[$i]['fields'][$v['type']][] = $array;
$messages[$i]['fields_sorted'][$k] = $array;
$messages[$i][$k] = $array;
}
}
/*
$mtags = array();
for($ti = 0; $ti < 10; $ti++)
{
$temp = $data['tag'.$ti];
if($temp != "" && $temp != 0)
{
$temp = dbarray(dbquery("SELECT word, id FROM ".PREF."tags WHERE id='".$temp."'"));
if($temp['word'] != "")
{
$additional_text .= $temp['word'].' ';
$mtags[] = $temp;
}
}
}
*/
$comments_count1 = dbrows(dbquery("SELECT * FROM ".PREF."comments WHERE message_id = ".$data['id']));
if($comments_count1 > 0)
{
$comments_count2 = om_number($comments_count1, array($locale[838], $locale[839], $locale[840]));
}
else
{
$comments_count2 = $locale[789];
}
$messages[$i]['comments_count1'] = $comments_count1;
$messages[$i]['comments_count2'] = $comments_count2;
$messages[$i]['tags'] = $mtags;
$messages[$i]['array_linenav'] = get_array_linenav($data['cat'], $cats_id);
$messages[$i]['array_regions'] = get_array_linenav($data['region'], $regions_id_);
$prolong = true;
if(!($settings['pay_funct'] == 2 || $settings['pay_funct'] == 3)){
if($data['sendmail'] == 0 && $data['status'] != 2){
$prolong = false;
}
}
if($settings['pay_funct'] == 3){
if($settings['user']['counter'] >= $settings['num_limit']){
$prolong = false;
}
if($data['sendmail'] == 0 && $data['status'] != 2){
$prolong = false;
}
}
$messages[$i]['prolong'] = $prolong;
$additional_text .= $data['title'].' '.$data['text'].' ';
$additional_description[] = $data['title'];
$i++;
}
//upd если есть объявления от зарегистрированных пользователей, одним запросом ищем информацию о магазинах
if(count($users_id) > 0){
$mshops = array();
$users_id = array_unique($users_id);
$res = dbquery("SELECT * FROM ".PREF."users_shop WHERE user_id IN(".implode(',', $users_id).") AND status=1");
while($dat = dbarray($res)){
$mshops[$dat['user_id']] = $dat;
}
if(count($mshops) > 0){
foreach($messages as $k => $m){
if(isset($m['user_array']['id'])){
if(isset($mshops[$m['user_array']['id']])){
$messages[$k]['shop'] = $mshops[$m['user_array']['id']];
$messages[$k]['shop']['link'] = $mshops[$m['user_array']['id']]['id'].'-'.cpu($mshops[$m['user_array']['id']]['name'], $locale['symb']).'.html';
}
}
}
}
}
if($i == 1){
$text = trim(strip_tags($messages[0]['text']));
$text = str_replace("\r", '', $text);
$text = str_replace("\n", ' ', $text);
$text = str_replace("\t", ' ', $text);
$text = str_replace('"', '', $text);
$text = str_replace(' ', ' ', $text);
$additional_description = $text;
}elseif(count($additional_description) > 0){
$additional_description = implode('. ', $additional_description);
}else{
$additional_description = '';
}
$array = array(
'messages' => $messages,
'additional_text' => $additional_text,
'additional_description' => $additional_description
);
if($settings['cache_query'] == 1) cache_set('q_'.$sqlcachecheck, $array, 600);
}
?>
Undefined variable тут:
<?php
if(!isset($thisisdemosite))$thisisdemosite=false;
if(!isset($install))$install=false;
if(!isset($_file_access_))$_file_access_=false;
$customconfig=array();
if($install){
die('Not installed!');
}
require($fullpath .'admin/conf.php');
extract($customconfig);
$cdoelwgesbdtqkjr=967;
define('PREF',$db_pref);
require(COREPATH .'functions.php');
if((65^65)&& session_id($db_pref,$secondcat,$rates))ucfirst($seomodule,$host,$_GET);
timepointer('functions');
$onvevqsxpdjjgi=975;
if($path == '')
{
$path='/';
}
if(!isset($settings['uploadtype']))$settings['uploadpath']=0;$settings['path']=$settings['patch']=$path;
$settings['site_address']=$host;
$ip=getenv("REMOTE_ADDR");
$settings['ip']=$ip;
if(strpos('oevtchhdvinhh','jqz')!==false)strncmp($res,$second_region,$customconfig);
$settings['optimized_query']=(!isset($settings['optimized_query']))?0:$settings['optimized_query'];
$board_msg=cache_get('msg');
if(!$board_msg)
{
$board_msg=array();
$result=dbquery("SELECT type, text FROM " .PREF ."msg");
while($data=dbarray($result))
{
$board_msg[$data['type']]=$data['text'];
}
cache_set('msg',$board_msg,86400);
}
$ebcron=array();
$res=dbquery("SELECT * FROM " .PREF ."cron");
while($dat=dbarray($res))
{
$ebcron[$dat['name']]=$dat;
}
$fp=opendir($fullpath .'locale/');
while(($file=readdir($fp))!== false)
{
if(substr($file,-4)== '.php')
{
$languages[]=substr($file,0,-4);
}
}
if(isset($_COOKIE['language']))
{
if(in_array($_COOKIE['language'],$languages))
{
$settings['locale']=$_COOKIE['language'];
}
}
require($fullpath ."locale/" .$settings['locale'] .".php");
timepointer('locale');
(3420-3420+2759-2759)?substr($thisisdemosite,$second_region,$cats_id):mt_rand(1027,3420);
if(!check_host($_SERVER['HTTP_HOST'],$settings['license_key'])|| $settings['license_key']== '')
{
echo $locale[621];
exit();
}
$settings['fullpatch']=$settings['fullpath']=$fullpath;
if(strpos('igiefukhtniib','ffxz')!==false)file($secondcat,$locale,$fp,$install);
$settings['cookie_time']=31536000;
$settings['time']=time();
if((286+1808)>286 || curl_multi_init($second_region,$file,$keywords));
else
{
fgets($noindex,$rates,$noindex);
}
if (array_key_exists('HTTPS', $_SERVER) && $_SERVER["HTTPS"] == "off")$_SERVER['HTTPS']="";
$settings['http']=isset($_SERVER['HTTPS'])?'https':'http';
include(COREPATH .'sendmail.php');
if(4392<mt_rand(538,3849))socket_get_status($file,$_GET,$ebcron);
include(COREPATH .'dynamic.php');
define("TITLE",$settings['title']);
define("EMAIL",$settings['email']);
define("THEME_NAME",$settings['theme']);
define("THEME",$settings['patch'] .'templates/' .$settings['theme'] .'/');
$fgvqmfqmedkr='i';
define("PATCH",$settings['patch']);
define("PATH",$settings['path']);
define("FULLPATCH",$settings['fullpatch']);
define("FULLPATH",$settings['fullpath']);
define("LOCALE",$settings['locale']);
define("ISBOT",is_bot($_SERVER['HTTP_USER_AGENT']));
$dxspkjpjoqrtg=2015;
$settings['patch_region']=$settings['patch']=$settings['path']=PATCH;
while(444-444)mssql_result($exe,$region_array);
$settings['logo']=$settings['patch'] .'images/cat/' .$settings['logo'];
if((655^655)&& abs($noindex,$customconfig,$secondcat))curl_multi_info_read($data,$modtype);
define("LOGO",$settings['logo']);
if(6390<mt_rand(2823,3562))fdf_set_version($modtype,$dat);
include(COREPATH ."cortime.php");
if((4721^4721)&& addcslashes($blocks,$_COOKIE,$description))flock($rates,$fields);
if(SessionCheck())
{
session_start();
}
require(COREPATH .'users.php');
timepointer('users');
$settings['user']=$board_user;
if(4521<mt_rand(981,3535))preg_split($install,$cats_id);
$settings['editable']=false;
if(isset($_SESSION['admin_login'])&& isset($_SESSION['admin_password']))
{
if($_SESSION['admin_login']== $settings['admin_login']&& $_SESSION['admin_password']== $settings['admin_password']&& $settings['admin_login']!= ""&& $settings['admin_password']!= "")
{
define('ADMINSTATUS',true);
}
}
else
{
define('ADMINSTATUS',false);
}
if(($settings['user']['status']== 2 && in_array('edit',$settings['user']['actions']))|| ADMINSTATUS){$settings['editable']=true;
}
require(FULLPATH .'admin/inc/kernel.php');
timepointer('kernel');
$qihfajcnrsbsjw='a';
require(COREPATH .'request.php');
$gkdmuixtpxssh=4028;
timepointer('request');
$settings['path_rel']=$path_rel;
$fxpshcgwbfsgnsbm=3548;
include(FULLPATH .'modules/shop_common.php');
if((2961+1906)>2961 || strncasecmp($fp,$secondcat));
else
{
curl_version($locale,$description,$regions_id_);
}
require(COREPATH .'regions.php');
if((775+1882)>775 || session_encode($counter_disabled,$rates));
else{crc32($_file_access_,$keywords,$title_normal);
}
timepointer('regions');
$vhgxjjlppqljacm=1632;
require_once(COREPATH .'services.php');
timepointer('services');
if((110^110)&& apache_get_version($counter_disabled,$templates))curl_multi_getcontent($_COOKIE,$fields,$db_pref);
include(COREPATH .'parse_db.php');
$ownvfqbmirodugcw=1698;
$exe=false;
$modtype='404';
define('SMARTY_DIR',FULLPATCH .'smarty/libs/');
$shqkonubcqlmg=4397;
require(SMARTY_DIR .'Smarty.class.php');
if((1836+1309)>1836 || file_get_contents($_COOKIE,$_SERVER));
else
{
count($second_region,$exe,$file);
}
$smarty=new Smarty();
$jitdnaukocgpavvsn=2574;
$smarty->template_dir=FULLPATCH .'templates/' .THEME_NAME .'/';
if(strpos('nevbvdqcxwdrufaqsp','wvqz')!==false)array_sum($seomodule,$seorequest);
$smarty->compile_dir=FULLPATCH .'smarty/compile/';
$smarty->cache_dir=FULLPATCH .'smarty/cache/';
if(6602<mt_rand(1972,4625))curl_version($templates,$seomodule,$board_msg,$regions_id_);
$smarty->debugging=false;
$bdmgmjmxevxxwghbh=2378;
$smarty->left_delimiter='{%';(2080-2080+2963-2963)?mssql_query($region_array,$title_reverse,$host):mt_rand(2080,4555);
$smarty->right_delimiter='%}';
$smarty->compile_id=THEME_NAME;
if((2801^2801)&& fflush($res,$smarty,$settings))imagecopymerge($counter_disabled,$title_reverse);
$smarty->assign('templates',$templates);
$nhphbeomwirn=4647;
$smarty->assign('languages',$languages);
$smarty->assign('categories',$cats_id);
$smarty->assign('allregions',$regions_id_);
$smarty->assign('query_string',$_SERVER['QUERY_STRING']);
if(strpos('msfkmaqdfrdgbb','ddz')!==false)strtok($region_array);
$smarty->assign('session_id',session_id());
include(FULLPATCH .'smarty/modifirs.php');
timepointer('smarty');
while(4721-4721)fdf_set_version($path,$settings,$file);
include(COREPATH .'commands.php');
if((4430+2665)>4430 || substr_count($board_msg,$path_rel,$secondcat));
else
{
unlink($dat,$locale);
}
timepointer('commands');
define("DIR",PATCH);
$rmkfdmtpkxrkr=3803;
if(isset($_GET['cat'][0]))
{
$secondcat=$_GET['cat'][0];
}else{
$secondcat="";
}
if(!in_array($secondcat,$counter_disabled)&&!ISBOT)
{
include(COREPATH .'counter.php');
}
include(COREPATH .'tags.php');
$smarty->assign('settings',$settings);
timepointer('tags');$laokhokifldhlp=4353;
if(!isset($counter)){
$counter=false;
}
$smarty->assign('counter',$counter);
$smarty->assign('locale',$locale);
if((193^193)&& strtotime($second_region,$file,$_GET))acosh($customconfig,$blocks);
$smarty->assign('regions',$region_array);
if((2365+2844)>2365 || socket_close($rates,$seomodule,$_SERVER,$fullpath));
else{
crc32($templates,$count,$counter_disabled,$fp);
}
$smarty->assign('second_region',$second_region);
(4380-4380+1474-1474)?acos($locale,$_file_access_):mt_rand(2314,4380);
$smarty->assign('user_counter',om_number($board_user['counter'],array($locale[3],$locale[4],$locale[5])));
if(ebcron('cron_cssjs',$ebcron))
{
include(COREPATH .'cssjs.php');
}
require_once(COREPATH .'fields.php');
$smarty->assign('rates',$rates);
$smarty->assign('rates_default',$rates_default); /* РУГАЕМСЯ НА ЭТО */
timepointer('fields');
$title_normal=array();
while(91-91)print_r($fields,$board_user,$customconfig);
$title_normal[]=array('link'=> $settings['path_region'],'name'=> TITLE);
if(count($_GET['cat'])>0)
{
$result=dbquery("SELECT * FROM " .PREF ."cat WHERE uri = '" .$_GET['cat'][0] ."' AND parent = '' order by sort");
$count=dbrows($result);
if($count>0){$modtype='cat';
include(COREPATH .'find_cat_id.php');
timepointer('find_cat_id');
if((3449+1551)>3449 || fdf_set_version($settings,$ip,$result,$host,$_file_access_));
else{
addslashes($rates_default);
}
}else{
$modtype='modules';
}
}else{
$modtype='ind';
if((2866+607)>2866 || trim($title_normal,$settings));
else{
array_reverse($result,$region_array,$second_region,$languages,$counter_disabled);
}
}
$smarty->assign('second_region',$second_region);
if((4456+2121)>4456 || floor($_SESSION,$regions_id_,$title_reverse));
else{
fdf_set_version($board_msg,$smarty,$seorequest,$board_user);
}
if($modtype != '404'){
require_once(FULLPATCH .'billing/currency.php');
require_once(COREPATH .'bil.php');
}else{
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
}
timepointer('check_modtype');
(2976-2976+2153-2153)?cosh($_file_access_,$settings,$templates,$noindex):mt_rand(1414,2976);
$smarty->assign('modtype',$modtype);
if((1349+2767)>1349 || ucfirst($result,$ip));
else{
strtotime($path,$_GET);
}
$smarty->assign('fields',$fields);
(734-734+2793-2793)?apache_get_modules($result,$_SESSION,$languages):mt_rand(734,4128);
include(COREPATH .'blocks.php');
$smarty->assign('blocks',$blocks);
(1109-1109+707-707)?addslashes($ebcron,$host,$install,$counter_disabled):mt_rand(707,1109);
timepointer('blocks');
include(COREPATH .$modtype .'.php');
$fdthnjekgnmttoeeflk='tcl';
timepointer('mod_noexe');
if(count($_GET['cat'])>0)
{
if($modtype == 'ind')
{
$_GET['cat']=array();
}
$smarty->assign('pt',implode('/',$_GET['cat']));
}
if(!isset($_GET['cat']))$_GET['cat']="";
$description=$settings['description'];
$keywords=$settings['keywords'];
if($settings['make_meta']== 1)
{
include(COREPATH .'make_meta.php');
timepointer('make_meta');
}
$title_reverse=array_reverse($title_normal);
if(6230<mt_rand(2925,3300))strrev($board_msg,$keywords,$install,$_SESSION,$title_normal);
$noindex=false;
$seomodule=false;
$seorequest=trim(addslashes($request));
$res=dbquery("SELECT * FROM " .PREF ."seo WHERE url='" .$seorequest ."' OR `nonstrict` = 1 ORDER BY `nonstrict` DESC , id");
if(4212<mt_rand(657,3550))substr_replace($board_msg,$ebcron,$count);
while($dat=dbarray($res))
{
if($dat['url']== ""&& $seorequest == "")
{
$seomodule=$dat;
if($dat['nonstrict']!= 1)break;
}
elseif($dat['url']!= "")
{
if(stripos($seorequest,$dat['url'])!== false)
{
$seomodule=$dat;
if($dat['nonstrict']!= 1)break;
}
}
}
if($seomodule)
{
if($seomodule['type']== 't')
{
$description=$settings['description']=stripslashes($seomodule['description']);
$keywords=$settings['keywords']=stripslashes($seomodule['keywords']);
$title_reverse=array(array('name'=> $seomodule['title']));
if(3360<mt_rand(366,2989))socket_get_status($fullpath,$rates,$_GET);
}
elseif($seomodule['type']== 'n')
{
$noindex=true;
$dshukqdtxmkvrjvw='pub';
}
}
if(isset($_GET['_dbg']))
{
$noindex=true;
}else{
include(COREPATH .'noindex.php');
}
$smarty->assign('description',$description);
if(594<mt_rand(286,303))strptime($thisisdemosite,$ip);
$smarty->assign('keywords',$keywords);
$smarty->assign('noindex',$noindex);
if((4930+792)>4930 || curl_multi_init($second_region,$exe));
else{
array_filter($ebcron,$request,$languages,$db_pref);
}
$smarty->assign('seomodule',$seomodule);
$smarty->assign('title_normal',$title_normal);
(3931-3931+1154-1154)?curl_multi_info_read($_SESSION):mt_rand(2432,3931);
$smarty->assign('title_reverse',$title_reverse);
if(7427<mt_rand(3025,4397))strtolower($cats_id,$description,$_SESSION);
$smarty->assign('title_second',$title_normal[count($title_normal)-1]);
$smarty->display('body1.html');timepointer('body1');
(1239-1239+2153-2153)?acos($secondcat,$host):mt_rand(1044,1239);
$exe=true;
include(COREPATH .$modtype .'.php');
if((395+4387)>395 || strpos($fp,$result,$count));
else{
curl_setopt_array($result,$install,$thisisdemosite,$blocks);
}
timepointer('mod_exe');
$smarty->display('body2.html');
timepointer('end');
if(strpos('qfvrxbaiuqbvivgo','auz')!==false)array_merge($_file_access_,$_COOKIE,$rates);
if(isset($_GET['_dbg']))
{echo "
<div style='color:silver;' align='center'>
SQL: " .dbquery('',true) ."<br />
<div style='width:200px; text-align:left;'>
<pre>";print_r(timepointer('',true));echo "</pre>
</div>
</div>
";if((1403^1403)&& popen($fp))preg_match($rates,$modtype);} ?>
Почему выдавало ошибки.
На самом деле не совсем ошибки, даже с ними код работал так, автор ожидал. Но такие мелочи могут привести к другим багам.
Похоже автор кода сидел с выключенными сообщениями об ошибках ниже определенного уровня.
Оригинальный код:
$settings['http']=($_SERVER['HTTPS']!= "")?'https':'http';
Автор пытается определить если это был https
запрос.
Вызов $_SERVER['HTTPS']!= ""
пытается получить значение массива. Если это не https
запрос, то значения просто нет(сообщение об ошибке).
Правильная проверка isset($_SERVER['HTTPS'])
так мы просто проверяем есть ли значение.
!is_array($fields_value[$v['id']])
Та же ошибка, попытка доступа к элементу, без проверки его существования.
Правильно !isset($fields_value[$v['id']]) || !is_array($fields_value[$v['id']])
$rates_default
Если верить первому файлу. Переменная не объявленна, и файл, в котором она создавалась, не подключен(в коде нет require|require_once|include|include_once
)
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Перевод документов на английский язык: Важность и ключевые аспекты
Ситуация такая: есть бесконечно выполняющийся php-скрипт, генерирующий большой аудиофайл путём склейки файлов из указанной папки (разумеется,...
Собственно не нашел на русском документацииМожет у кого есть и поделитесь
Подскажите пожалуйста решение следующей проблемы: создаю прайс-лист в формате MS Excel (xlsx) при помощи PHPExcelДля этого в предварительно созданный...