Foros del Web » Programando para Internet » PHP »

PHP Script sin funcionar en PHP5

Estas en el tema de PHP Script sin funcionar en PHP5 en el foro de PHP en Foros del Web. Hola, buenos dias... tengo un script que funciona perfecto con easyphp 1.7 que trae la version de PHP4 pero con easyphp 2.0b1 que trae PHP ...
  #1 (permalink)  
Antiguo 02/11/2008, 08:56
 
Fecha de Ingreso: noviembre-2008
Mensajes: 3
Antigüedad: 15 años, 5 meses
Puntos: 0
PHP Script sin funcionar en PHP5

Hola, buenos dias... tengo un script que funciona perfecto con easyphp 1.7 que trae la version de PHP4 pero con easyphp 2.0b1 que trae PHP 5 no.

ojalá alguien pueda ayudarme a hacerlo funcionar nuevamente.

explico de que se trata: es un script para ver la lista de asesinos por asi decirlo con mas muertes, de un juego llamado Helbreath, entonces saca de cada txt los "EK" enemy killed y los ordena para ver el TOP 10 de asesinos con mas muertes.

Código:
<?
Error_reporting(0);
/*
-=--=--=--=--=--=--=--=--=-
HB Pyknic, Helbreath
Private Server Resources

http://hb.magsec4.net
-=--=--=--=--=--=--=--=--=-

notes:
Thanks again to DarkZero for original top10 script,
this one is edited to display top10 people with most eks.
enjoy.

version: 1.0

*/
/*-----------Edit the line below this-------------*/
$chardir = "C:\\xxx\\Server\\Character";
/*-----------Edit the line above this-------------*/
$asc = 65;
while($asc < 122){
  $handle = $chardir;
  $handle .= '\\ASCII';
  $handle .= $asc;
  $filename = $handle;
  if(!is_readable($filename)){ }
  elseif($handle = opendir($filename)){
    while($file = readdir($handle)){ 
      if ($file != "." && $file != ".." && $file != "" && $file != ".txt") { 
        $filename = ''.$chardir.'\\ASCII'.$asc.'\\'.$file.'';
        $filepath = $filename;
        $moo = ereg_replace(".bak","\n",$filepath);
        if(!is_readable($moo)){ }
        else{
          $lines = file($filepath);
          $aexp = substr($lines[32], 20);
          $aname = ereg_replace("= ","",substr($lines[6], 20));
          $alevel = ereg_replace(" ","",substr($lines[23], 20));
          $alocation = substr($lines[12], 23, 7);
          $blocation = substr($lines[12], 23, 6);
          $aek = ereg_replace("character-EK-Count =","\n",$lines[39]);
          if($alocation == "aresden"){
            $arexp = array_merge($arexp,$aexp);
            $arlevel = array_merge($arlevel, $alevel);
            $arname = array_merge($arname, $aname);
            $arek = array_merge($arek, $aek);
          }
          elseif($blocation == "elvine"){
            $elexp = array_merge($elexp,$aexp);
            $ellevel = array_merge($ellevel, $alevel);
            $elname = array_merge($elname, $aname);
            $elek = array_merge($elek, $aek);
          }
        }
      }
    }
  }
  $asc = $asc + 1;
}
if(!$arexp){ }
elseif(!$elexp){ }
else{
array_multisort($arek, SORT_DESC, SORT_NUMERIC, $arlevel, $arname, $arexp);
array_multisort($elek, SORT_DESC, SORT_NUMERIC, $ellevel, $elname, $elexp);
}
/*--------Edit below this is you wish to change how the top 10 list looks------*/
echo "<body bgcolor=\"#000000\" text=\"#00FFFF\" link=\"#000000\">
<font face=arial>
<p align=center>Top 10 Aresden EKers
<table width=\"90\" border=\"2\">
  </em>
  <tr>
  <td>Position</td>
    <td>Player</td>
    <td>Level</td>
    <td>Experience</td>
    <td>EK Count</td>
  </tr>
  <tr>
  <td>1</td>
    <td>$arname[0]</td>
    <td>$arlevel[0]</td>
    <td>$arexp[0]</td>
    <td>$arek[0]</td>
  </tr>
  <tr>
  <td>2</td>
    <td>$arname[1]</td>
    <td>$arlevel[1]</td>
    <td>$arexp[1]</td>
    <td>$arek[1]</td>
  </tr>
  <tr>
  <td>3</td>
    <td>$arname[2]</td>
    <td>$arlevel[2]</td>
    <td>$arexp[2]</td>
    <td>$arek[2]</td>
  </tr>
  <tr>
  <td>4</td>
    <td>$arname[3]</td>
    <td>$arlevel[3]</td>
    <td>$arexp[3]</td>
    <td>$arek[3]</td>
  </tr>
  <tr>
  <td>5</td>
    <td>$arname[4]</td>
    <td>$arlevel[4]</td>
    <td>$arexp[4]</td>
    <td>$arek[4]</td>
  </tr>
  <tr>
  <td>6</td>
    <td>$arname[5]</td>
    <td>$arlevel[5]</td>
    <td>$arexp[5]</td>
  <td>$arek[5]</td>
  </tr>
  <tr>
  <td>7</td>
    <td>$arname[6]</td>
    <td>$arlevel[6]</td>
    <td>$arexp[6]</td>
  <td>$arek[6]</td>
  </tr>
  <tr>
  <td>8</td>
    <td>$arname[7]</td>
    <td>$arlevel[7]</td>
    <td>$arexp[7]</td>
  <td>$arek[7]</td>
  </tr>
  <tr>
  <td>9</td>
    <td>$arname[8]</td>
    <td>$arlevel[8]</td>
    <td>$arexp[8]</td>
  <td>$arek[8]</td>
  </tr>
  <tr>
  <td>10</td>
    <td>$arname[9]</td>
    <td>$arlevel[9]</td>
    <td>$arexp[9]</td>
  <td>$arek[9]</td>
  </tr>
</table>
<body bgcolor=\"#666666\" text=\"#CCCCCC\" link=\"#000000\">
<font face=arial>
<p align=center>Top 10 Elvine EKers
<table width=\"90\" border=\"2\">
  </em>
  <tr>
  <td>Position</td>
    <td>Player</td>
    <td>Level</td>
    <td>Experience</td>
    <td>EK Count</td>
  </tr>
  <tr>
  <td>1</td>
    <td>$elname[0]</td>
    <td>$ellevel[0]</td>
    <td>$elexp[0]</td>
    <td>$elek[0]</td>
  </tr>
  <tr>
  <td>2</td>
    <td>$elname[1]</td>
    <td>$ellevel[1]</td>
    <td>$elexp[1]</td>
    <td>$elek[1]</td>
  </tr>
  <tr>
  <td>3</td>
    <td>$elname[2]</td>
    <td>$ellevel[2]</td>
    <td>$elexp[2]</td>
    <td>$elek[2]</td>
  </tr>
  <tr>
  <td>4</td>
    <td>$elname[3]</td>
    <td>$ellevel[3]</td>
    <td>$elexp[3]</td>
    <td>$elek[3]</td>
  </tr>
  <tr>
  <td>5</td>
    <td>$elname[4]</td>
    <td>$ellevel[4]</td>
    <td>$elexp[4]</td>
    <td>$elek[4]</td>
  </tr>
  <tr>
  <td>6</td>
    <td>$elname[5]</td>
    <td>$ellevel[5]</td>
    <td>$elexp[5]</td>
  <td>$elek[5]</td>
  </tr>
  <tr>
  <td>7</td>
    <td>$elname[6]</td>
    <td>$ellevel[6]</td>
    <td>$elexp[6]</td>
  <td>$elek[6]</td>
  </tr>
  <tr>
  <td>8</td>
    <td>$elname[7]</td>
    <td>$ellevel[7]</td>
    <td>$elexp[7]</td>
  <td>$elek[7]</td>
  </tr>
  <tr>
  <td>9</td>
    <td>$elname[8]</td>
    <td>$ellevel[8]</td>
    <td>$elexp[8]</td>
  <td>$elek[8]</td>
  </tr>
  <tr>
  <td>10</td>
    <td>$elname[9]</td>
    <td>$ellevel[9]</td>
    <td>$elexp[9]</td>
  <td>$elek[9]</td>
  </tr>
</table>";
?>
<center>
<?
$fp = fopen("http://hb.magsec4.net/ek10.txt", "r");
 $temp = fread($fp, 1024);
 fclose($fp);
 $temp2 = explode("\n", $temp);
 $rv = "$temp2[0]";
 $fv = "1.0";

if($rv == $fv){
	echo "EK10 Script by Magsec4, version <font color=lime>$fv</font>.";
}
else{
	echo "<font color=red>Script outdated, version <a href=http://hb.magsec4.net>$rv</a> available.</font>";
}
?> 
</center>
nota: he agregado el inicio de php con <?php pero aun asi nada, no se si habra que activar algun modulo en php5.
  #2 (permalink)  
Antiguo 02/11/2008, 09:07
 
Fecha de Ingreso: noviembre-2002
Mensajes: 1.341
Antigüedad: 21 años, 5 meses
Puntos: 17
Respuesta: PHP Script sin funcionar en PHP5

Más datos...

¿Por qué no funciona? ¿cuál es su comportamiento? ¿qué comportamiento sería el deseado?
Cambia el error_reporting para que se reporten ttodos los errores y así vemos qué falla y dónde.
  #3 (permalink)  
Antiguo 02/11/2008, 09:33
 
Fecha de Ingreso: noviembre-2008
Mensajes: 3
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: PHP Script sin funcionar en PHP5

Mas datos...

1) No funciona porque no carga la lista con cada jugador y con su cantidad de EKs.
2) Su comportamiento es dejar los casilleros en blanco sin informacion tomada de los .TXT
3) Tendria que aparecer la lista de los 10 Jugadores de cada ciudad que son 2, con su respectiva cantidad de EKS (enemigos asesinados)
4) Active el error_reporting, aqui puedes ver.

Código:
Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 62

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 83

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 84

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 85

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 86

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 90

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 91

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 92

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 93

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 97

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 98

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 99

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 100

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 104

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 105

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 106

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 107

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 111

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 112

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 113

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 114

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 118

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 119

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 120

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 121

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 125

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 126

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 127

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 128

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 132

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 133

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 134

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 135

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 139

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 140

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 141

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 142

Notice: Undefined variable: arname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 146

Notice: Undefined variable: arlevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 147

Notice: Undefined variable: arexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 148

Notice: Undefined variable: arek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 149

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 166

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 167

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 168

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 169

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 173

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 174

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 175

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 176

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 180

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 181

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 182

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 183

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 187

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 188

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 189

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 190

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 194

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 195

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 196

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 197

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 201

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 202

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 203

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 204

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 208

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 209

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 210

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 211

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 215

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 216

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 217

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 218

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 222

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 223

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 224

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 225

Notice: Undefined variable: elname in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 229

Notice: Undefined variable: ellevel in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 230

Notice: Undefined variable: elexp in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 231

Notice: Undefined variable: elek in C:\Program Files\EasyPHP 2.0b1\www\ek10.php on line 232
  #4 (permalink)  
Antiguo 02/11/2008, 09:51
 
Fecha de Ingreso: noviembre-2002
Mensajes: 1.341
Antigüedad: 21 años, 5 meses
Puntos: 17
Respuesta: PHP Script sin funcionar en PHP5

Umm, asegurate de que está leyendo el fichero correctamente
  #5 (permalink)  
Antiguo 02/11/2008, 10:23
 
Fecha de Ingreso: abril-2003
Ubicación: Mexico
Mensajes: 604
Antigüedad: 21 años
Puntos: 23
Respuesta: PHP Script sin funcionar en PHP5

buenas!!

solo te lo hace con ese script o tambien con otros .php

porque si es asi pudieras tener problemas en la declaracion de las extenciones ejacutables

un saludo!!
__________________
¡El Respeto al Derecho Ajeno Es la Paz!
  #6 (permalink)  
Antiguo 02/11/2008, 11:19
 
Fecha de Ingreso: noviembre-2008
Mensajes: 3
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: PHP Script sin funcionar en PHP5

me lo hace con ese y otros mas, no se si seran las variables o que, no dominio mucho el PHP, pero lo que yo puse en el primer post es la diferencia entre PHP's con el 4 funciona correctamente y con el 5 no.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:05.