Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
scheduler is on a distinguished road
 
Posts: 5
Join Date: Aug 2008
Unhappy I don't use Geshi - 08-16-2008, 04:59 AM

Hi, this is my problem...

I have this file with Geshi code resaltarCodigo.php:

PHP Code:
<?php
require  'geshi/geshi.php';            /* Incluir la libreria del resaltador de sintaxis Geshi*/
/* Funcion que recibe un nombre de archivo para mostra resaltado su codigo, tambien recibe la extension
   del archivo para determinar el lenguaje de programacion */
function mostrarCondigo($elArchivo,$tipo)
{                                          
/* Inicio del cuerpo de la funcion*/
  /*Podemos mostrar resaltado solamente un segmento de codigo, inicializando una variable con dicho codigo */
  //$codigo="int number;
  //bool yes;
  //number=5;
  //yes=true;";

  
$archivo $elArchivo.".".$tipo;               /*Indicar cual archivo abrir*/
  
$punteroArch fopen($archivo,'r');            /*abrimos el archivo en lectura*/

  
$codigo fread($punteroArchfilesize($archivo));       /* leemos el archivo */
  
$lenguaje=$tipo;                     /*Indicar el lenguaje de programacion a resaltar*/

  
$migeshi= & new GeSHi($codigo,$lenguaje);

  
$migeshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERStrue);    /* Activar la numeracion de lineas */
  
$migeshi->set_line_style('background: yellow''background: #DFEEF3'true);             /* cambiar estilo de numeros de lines*/

?>
   <table width="100%%"  align="center" cellpadding="0" cellspacing="0" bgcolor=#E8E8E8 border=0 bordercolor="#13bfff">
     <tr><td align="center" bgcolor=#DFEEF3><b><font color="blue">Codigo <?php echo $tipo?></font></b></td></tr>
     <tr><td><?php echo $migeshi->parse_code(); ?></td></tr>
   </table>
<?php
  fclose
($punteroArch);        /* Cerrar el archivo abierto */
}                                  /* Fin del cuerpo de la funcion*/
?>
and in other file (home.php) I use the function (from resaltarCodigo.php) here.


PHP Code:
                 require("resaltarCodigo.php");         /* Incluir la funcion para resaltar codigo */
                 
mostrarCondigo("prog1","ASM");   /* Mandar a la funcion de resaltar el nombre del archivo y su tipo*/
                 
echo "<br><br>";
                 
mostrarCondigo("progc2","C");   /* Mandar a la funcion de resaltar el nombre del archivo y su tipo*/ 
I don't have problems in my localhost. my problem is here (in the server).
Can I use the functions fopen, fclose, fread in this server or not?

BUGS:
Warning: fopen(prog1.ASM) [function.fopen]: failed to open stream: No such file or directory in /home/a9262465/public_html/resaltarCodigo.php on line 14

Warning: filesize() [function.filesize]: stat failed for prog1.ASM in /home/a9262465/public_html/resaltarCodigo.php on line 16

Warning: fread(): supplied argument is not a valid stream resource in /home/a9262465/public_html/resaltarCodigo.php on line 16

Warning: fclose(): supplied argument is not a valid stream resource in /home/a9262465/public_html/resaltarCodigo.php on line 30

jajaj, my english is horrible. no?
but, please help me.

thanks


...no soy un completo idiota, faltan algunas partes

http://gonzasilve.net84.net/
Reply With Quote
(#2 (permalink))
Old
Junior Member
scheduler is on a distinguished road
 
Posts: 5
Join Date: Aug 2008
Talking problem solved - 08-16-2008, 09:44 PM

thanks. solve my problem


...no soy un completo idiota, faltan algunas partes

http://gonzasilve.net84.net/
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
vBulletin Skin developed by: vBStyles.com