Current Path : /web/htdocs/www.entinoprofit.org/home/database/
Upload File :
Current File : /web/htdocs/www.entinoprofit.org/home/database/luogo.php

<?php

$luogo = strtoupper($_GET['luogo']);

if ( strlen( $luogo ) != 0 )
{
    $ascii_code = ord( substr( $luogo, 0, 1 ) );
  
  $file_path = "Comuni";
    
	if		( $ascii_code >= 65 && $ascii_code <= 75 ) $file_path .=  "/comuniAK.ini" ;
	else if ( $ascii_code >= 76 && $ascii_code <= 77 ) $file_path .=  "/comuniLM.ini" ;
	else if ( $ascii_code >= 78 && $ascii_code <= 81 ) $file_path .=  "/comuniNQ.ini" ;
	else if ( $ascii_code == 82 ) $file_path .=  "/comuniR.ini" ;
	else if ( $ascii_code == 83 ) $file_path .=  "/comuniS.ini" ;
	else if ( $ascii_code >= 84 && $ascii_code <= 85 ) $file_path .=  "/comuniTU.ini" ;
	else if ( $ascii_code >= 86 && $ascii_code <= 90 ) $file_path .=  "/comuniVZ.ini" ;

  echo "<pre>\n" ;
  
  $fileHandle = fopen( $file_path, "r" );

  $contents = "";
  
  while ( false !== ($char = fgetc( $fileHandle ) ) )
  { 
      if ( strcmp( $char, "=" ) == 0 ) $buffer=fgets( $fileHandle, 5 ) ; 
      if ( strcmp( $char, "[" ) == 0 ) $buffer=fgets( $fileHandle, 8 ) ; 
      else $contents .= $char ;
  }  
  $contents = str_replace( "_", " ", $contents );
  $contents = str_replace( "=", "", $contents );

  fclose( $fileHandle );
  
  echo $contents ;  
  
  echo "</pre>";

}


?>