Hosting de Calidad
  • Inicio
  • Precios y servicios
  • F.a.q y ayudas
  • Realizar pedido
  • Webs alojadas
  • Quienes somos
  • Foro HyD
  • Contacto

    Zona Dominios

    Entrar
    registro de dominios


    Zona Hosting

    Entrar
    alojamiento web


    5 Métodos de Pago
    Tarjeta de crédito
    Domiciliación
    Transferencia
    Soporte Epagado
    Soporte Paypal

    Liberalización .es

    Ver mas
    dominios .es


  •  
     
     
    highlight_file

    highlight_file

    (PHP 4 )

    highlight_file __ Syntax highlighting of a file

    Description

    mixed highlight_file ( string filename [, bool return])

    The highlight_file() function prints out a syntax higlighted version of the code contained in filename using the colors defined in the built_in syntax highlighter for PHP_

    If the second parameter return is set to TRUE then highlight_file() will return the highlighted code as a string instead of printing it out_ If the second parameter is not set to TRUE then highlight_file() will return TRUE on success, FALSE on failure_

    Nota: The return parameter became available in PHP 4_2_0_ Before this time it behaved like the default, which is FALSE

    Atención

    Care should be taken when using the show_source() and highlight_file() functions to make sure that you do not inadvertently reveal sensitive information such as passwords or any other type of information that might create a potential security risk_

    Nota: Since PHP 4_2_1 this function is also affected by safe_mode and open_basedir_

    To setup a URL that can code hightlight any script that you pass to it, we will make use of the "ForceType" directive in Apache to generate a nice URL pattern, and use the function highlight_file() to show a nice looking code list_

    In your httpd_conf you can add the following:

    Ejemplo 1_ Creating a source highlighting URL

    <Location /source>
        ForceType application/x_httpd_php
    </Location>

    And then make a file named "source" and put it in your web root directory_

    <html>
    <head>
    <title>Source Display</title>
    </head>
    <body bgcolor="white">
    <?php
        $script = getenv("PATH_TRANSLATED");
        if (!$script) {
            echo "<br /><b>ERROR: Script Name needed</b><br />";
        } else {
            if (ereg("(\_php|\_inc)$",$script)) {
                echo "<h1>Source of: $PATH_INFO</h1>\n<hr />\n";
                highlight_file($script);
            } else {
                echo "<h1>ERROR: Only PHP or include script names are allowed</h1>"; 
            }
        }
        echo "<hr />Processed: "_ date("Y/M/d H:i:s", time());
    ?>
    </BODY>
    </HTML>

    Then you can use an URL like the one below to display a colorized version of a script located in "/path/to/script_php" in your web site_

    http://your_server_com/source/path/to/script_php

    See also highlight_string()_

     
       



    registro de dominios | alojamiento web | hosting por publicidad

       

     

    Manual de linux Manual de apache Manual de php Manual de mysql Manual de SQL Manual del Plesk Como funciona Paypal Manual de html