ezs Posted October 13, 2005 Report Share Posted October 13, 2005 man ir radies tāds interesantas dabas jautājums tātad tagad sāku raxtīt kodu uz register_globals = off kas droši vien arī būtu pareizi, bet kādēļ šis man tiek atgriesta notīce: Notice: Undefined index: m_id in mans/serveris/index.php on line 16 šis erors protams pazūd tiklīdz es nododu to manīgo (caur $_GET) ceru ka manu jautājumu sapratāt nu negribas man slēgt tos erooru ārā, bet kā lai pareizi rakasta kodu ja rodas šādas te aizķeršanās? Link to comment Share on other sites More sharing options...
litt Posted October 13, 2005 Report Share Posted October 13, 2005 (edited) Kaut kur savā kodā tu centies piekļūt neeksistējošam masīva elementam. Uzliec pārbaudi if(isset($masivs['elements'])) vai arī $mainigais = $masivs['elements'] ? $masivs['elements'] : ''; Edited October 13, 2005 by litt Link to comment Share on other sites More sharing options...
v3rb0 Posted October 13, 2005 Report Share Posted October 13, 2005 (edited) edit: neatkārtošu litt teikto Edited October 13, 2005 by v3rb0 Link to comment Share on other sites More sharing options...
AcidRain Posted October 13, 2005 Report Share Posted October 13, 2005 Es persoņīgi izmantoju: $name = !empty($_GET['name']) ? $_GET['name'] : ''; Attiecīgi izmantoju saīsināto if un empty funkciju. empty izmantoju jo tas atgriež arī false, ja mainīgais ir definēts, bet tukšs. Link to comment Share on other sites More sharing options...
Delfins Posted October 13, 2005 Report Share Posted October 13, 2005 http://php.lv/f/index.php?showtopic=3104&v...indpost&p=23689 Link to comment Share on other sites More sharing options...
Recommended Posts