Jump to content
php.lv forumi

Recommended Posts

Posted

Izmet Notice: Undefined index: admin in C:\Program Files\Apache Group\Apache\htdocs\private\inc\libs.inc on line 370

}

function adminMode () {

if (sizeof($_COOKIE)>0)

{

session_start();

if ($_SESSION['admin'] == true)

{

return true;

}

else

{

return false;

}

}

else

{

return false;

}

}

Posted

Nevajag taisīt muļķīgas QUOTEs!

 

Nostraadaaja, bet ko dot papildus isset

Ir vel dazas kludas - varbut vari palidzet?

Undefined index: PATH_INFO in C:\Program Files\Apache Group\Apache\htdocs\private\inc\libs.inc on line 80

Undefined index: print in C:\Program Files\Apache Group\Apache\htdocs\private\inc\libs.inc on line 83

{

include ('navi.inc');

$this->connection=$this->doConnect($connstring);

$this->encoding=$langprops[$language]['internal'];

$this->page=$pages[$language][$name];

$this->page['encoding']=$langprops[$language]['template'];

$this->page['adminmode']=$this->adminMode();

$this->page['params']=$this->getParams();

$this->page['sliders']=$this->arrRandom(2, 4);

$this->page['sourceurl']='http://'.$_SERVER["SERVER_NAME"].$_SERVER['PHP_SELF'].$_SERVER['PATH_INFO'];

$this->page['basicsitevars']=$this->readBasicsItem($this->page);

if ($_GET['print']=='true')

{

 

$this->page['template']=$printtpl[$language];

$this->page['printmode']=true;

}

//$this->readNews(false, Array(3),3,3);

}

Posted

isset tavā gadījumā pārbauda vai masīvā ir meklētais elements.

Tavas "Undefined index" kļūdas vari salabot nelietojot par masīva indeksiem neeksistējošus masīva elementu atslēgas.

Posted
Undefined index: PATH_INFO in C:\Program Files\Apache Group\Apache\htdocs\private\inc\libs.inc on line 80

 

nav definets define("PATH_INFO", "...");

Posted
isset tavā gadījumā pārbauda vai masīvā ir meklētais elements.

Tavas "Undefined index" kļūdas vari salabot nelietojot par masīva indeksiem neeksistējošus masīva elementu atslēgas.

Kuras sajaa gadijumaa skaitaas masiivu elementu atsleegas?

Posted (edited)

man no kurienes zinat ko tu gribi ar PATH_INFO definet ... define("PATH_INFO", "tas ko tu gribi ar to definet");

$this->page['sourceurl']='http://'.$_SERVER["SERVER_NAME"].$_SERVER['PHP_SELF'].PATH_INFO.'';

Edited by 777
Posted
man no kurienes zinat ko tu gribi ar PATH_INFO definet ... define("PATH_INFO", "tas ko tu gribi ar to definet");

$this->page['sourceurl']='http://'.$_SERVER["SERVER_NAME"].$_SERVER['PHP_SELF'].PATH_INFO.'';

Vai taa nevareetu buut, ka nav iisti nokonfigurets apachis, php, vai nav nomainitas dir. celi, jo sim visam vajadzeetu iet bez mainiisanas, jo lapa ir nemta straadaajosa.

Posted (edited)

no dokumentācijas: http://lv.php.net/reserved.variables

'PATH_TRANSLATED'

Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.

 

Note: As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as the SCRIPT_FILENAME server variable when it's not populated by Apache. This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist if PATH_INFO is defined. Apache 2 users may use AcceptPathInfo = On inside httpd.conf to define PATH_INFO.

Edited by Aleksejs
Posted

varbūt php koda sākumā palaid šo rindiņu:

error_reporting(E_ALL & ~E_NOTICE);

 

tas atslēgs E_NOTICE kļūdu rādīšanu.

error reporting vērtību var uzlikt arī iekš php.ini

×
×
  • Create New...