ray Posted August 8, 2006 Report Share Posted August 8, 2006 man konfigurācijas failā fails.inc stāv info: <? $db_host = "localhost"; $db_user = "lietotajs"; $db_password = "password"; $db_name = "datubaze"; $connection = @mysql_connect($db_host, $db_user, $db_password) or die("Nevar piekļūt datu bāzei..."); mysql_select_db($db_name); ?> bet problēma tāda, ka ierakstot pārlūkā konkrētu šī faila adrese, tas izvada šo pašu kodu. ko lai es izdaru/uzrakstu, lai man nerādītu un neatklātu pārlūkā šo kodu? Link to comment Share on other sites More sharing options...
eglitis Posted August 8, 2006 Report Share Posted August 8, 2006 1) fails jāievieto no web nepieejamā mapē 2) faila paplašinājumam jābūt php 3) apache iestatījumos jānorāda, ka inc faili tie paši php faili vien ir. Link to comment Share on other sites More sharing options...
ra001 Posted August 8, 2006 Report Share Posted August 8, 2006 <?PHP $db_host = "localhost"; .... Man liekas ka tā jābūt, kaut gan dažreiz interpretātors arī bez tā saprot... Link to comment Share on other sites More sharing options...
v3rb0 Posted August 8, 2006 Report Share Posted August 8, 2006 pilnīgi visus php scriptus saucam ar extensionu ".php" - kāda jēga nosaukt ar inc un tad domāt ko pamainīt konfigā lai to webā neredzētu? Link to comment Share on other sites More sharing options...
jauninjais Posted August 8, 2006 Report Share Posted August 8, 2006 vai shis nepaliidz <Files ~ "\.inc$"> Order allow,deny Deny from all </Files> Link to comment Share on other sites More sharing options...
Recommended Posts