Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/03/2004, 14:51
Ragonicha_fulva
 
Fecha de Ingreso: marzo-2004
Mensajes: 13
Antigüedad: 20 años, 1 mes
Puntos: 0
Error con fgets() que no se manifiesta en local

Hola a todos!

He realizado una página en php que me lee un .txt y me lo escribe en la web.

Trabajando en local con Windows2000 y IIS me funciona bien, pero al colgar la web en una máquina linux me da el siguiente error:

Warning: Wrong parameter count for fgets() in /home/httpd/vhosts/mizares.com/httpdocs/planeta_carta.php on line 60

Warning: Wrong parameter count for fgets() in /home/httpd/vhosts/mizares.com/httpdocs/planeta_carta.php on line 63

Warning: Wrong parameter count for fgets() in /home/httpd/vhosts/mizares.com/httpdocs/planeta_carta.php on line 66

Warning: Wrong parameter count for fgets() in /home/httpd/vhosts/mizares.com/httpdocs/planeta_carta.php on line 74

Warning: Wrong parameter count for fgets() in /home/httpd/vhosts/mizares.com/httpdocs/planeta_carta.php on line 77

Warning: Wrong parameter count for fgets() in /home/httpd/vhosts/mizares.com/httpdocs/planeta_carta.php on line 80

El código de la páguna php es:

<?php
session_start();
?>
<HTML>
<HEAD>
<style>
BODY {
background-attachment : fixed;
background-image : url(http://www.mizares.com/imatges/planeta_carta1.jpg);
background-position : center;
background-repeat : no-repeat;
scrollbar-arrow-color:#67581B;
scrollbar-track-color:white;
scrollbar-shadow-color:#67581B;
scrollbar-face-color:#E2CC81;
scrollbar-highlight-color:#E6E6E6;
scrollbar-darkshadow-color:white;
scrollbar-3dlight-color:white;
}
H2 {
color : "#733C1A";
font : bold italic;
}
H3 {
color : "#733C1A";
font : bold;
}

</style>
</HEAD>
<BODY>
<img src="imatges/logo_carta2.jpg" alt="" border="0">
<?php

//si $_GET ['tipo'] = 1 es una tertulia y si es 2 es una seleccion

//recuperamos dato de la página anterior
$numTertulia = $_GET ['numTertulia'];

$strArchivo = "atrasados/" . $numTertulia; //nombre de archivo a mostrar
$strSelecc = "tertulia_en_mizar/selecciones/" . $numTertulia; //nombre de seleccion a mostrar

if ($_GET ['tipo'] == 1) //Es un num publicado...
{
$strNombreArchivo = $strArchivo;
}
elseif ($_GET ['tipo'] == 2) //ES una seleccion
{
$strNombreArchivo = $strSelecc;
}



//abrimos el fichero

$fd = fopen($strNombreArchivo, 'r');

If (!feof($fd))
{
$buffer = fgets($fd); //Lee pero no se escribe "Mizares"
echo "<h1> </h1>\n<br>\n";

$buffer = fgets($fd); //Escribe "La Tertulia en Mizar"
echo "<h2>",$buffer,"</h2>\n<br>\n";

$buffer = fgets($fd); //Escribe la fecha
echo "<table align='left' width='85%' border='0'>\n<tr>\n<td>\n<h2>\n", substr($buffer,0,30),"</h2>\n</td>\n<td align='right'>\n<h2>\n";
if ($_GET ['tipo'] == 1)
{
echo substr($buffer,-15); //Si no es seleccion y es una tertulia hay que poner el número de tertulia
}
echo "</h2>\n</td>\n</tr>\n</table>\n<br><br>\n";

$buffer = fgets($fd); //Escribe un espacio en blanco
echo $buffer,"\n<br>\n";

$buffer = fgets($fd); //Escribe un espacio en blanco
echo $buffer,"\n<br>\n";

$buffer = fgets($fd); //Escribe el "Temario"
echo "<h3><U>",$buffer,"</U></h3><br>";

echo "<table width='80%' align='center'><tr><td>";

//Leemos el fichero linea a linea y lo imprimimos en la web
while (!feof($fd))
{
$buffer = fgets($fd);
echo $buffer . "<br>";
}
echo "</td></tr></table>";
}

fclose($fd);

?>

</BODY>
</HTML>


Os agradeceré cualquier ayuda que me podáis prestar.

Muchas gracias!