Foros del Web » Programando para Internet » PHP »

Sitio en PHP4 no funciona en PHP5 (porfa urge su ayuda)

Estas en el tema de Sitio en PHP4 no funciona en PHP5 (porfa urge su ayuda) en el foro de PHP en Foros del Web. Hola. Acabo de cambiar de hosting y resulta que en este nuevo la versión PHP es 5.2 y el sitio que subi esta hecho en ...
  #1 (permalink)  
Antiguo 29/01/2011, 01:21
 
Fecha de Ingreso: marzo-2007
Mensajes: 9
Antigüedad: 17 años, 1 mes
Puntos: 0
Sitio en PHP4 no funciona en PHP5 (porfa urge su ayuda)

Hola.

Acabo de cambiar de hosting y resulta que en este nuevo la versión PHP es 5.2 y el sitio que subi esta hecho en PHP4 conectado a una BD Mysql.

El detalle es que al parecer si se conecta a la BD pero no se ejecutan los links del sitio que se supenen, llama al contenido de la BD para mostrarse en la página, por ej, este es un link del sitio: (http://www.misitio.com/index2.php?proceso=1&widentificacion=124), pero cuando le doy click e ese link, no funciona, solo me regresa a la página inicial, no sé por que, ya que en el hosting anterior funcionaba perfecto: esta es una parte del sitio, que muestra las noticias en la página principal:

Código PHP:
<?php
$indi
="1";
if (
$tope==0){
    
$tope=$cuenta 5;}
    else{
    
$tope=$cuenta 4;
    }

if (
$tope 5){
    
$tope++;
    }

$inicio=$cuenta;
$cuenta=0;
$okis=0;
echo 
'<div align="center" style="color: black; font-family: arial; font-size: 12;">';
switch (
$tarea)
{

  case 
"noticias":
  
$cadenadelquery="select * from pricipal where seccion='NOTICIAS' ORDER BY identificacion DESC";
  
$resultado=mysql_query($cadenadelquery$conexion);
  echo 
mysql_error();
  echo 
"NOTICIAS";
  break;

  default:    
  
$cadenadelquery="select * from principal where seccion='NOTICIAS' ORDER BY identificacion DESC";
  
$resultado=mysql_query($cadenadelquery$conexion);
  echo 
mysql_error();
}
echo 
'</div>';
while (
$row=mysql_fetch_array($resultado)) 
    {
    
$indi++;
    if (
$indi>2){$indi=1;}
    if (
$cuenta $tope){$cuenta++;}    
    
    if (
$cuenta $inicio AND $cuenta $tope){
        if(
$indi==2){
            echo 
'<table width="100%" style="color: black; font-family: arial; font-size: 12;">';
            echo 
'<tr valign="top">';
                echo 
'<td height="2"><img src="cab-new.jpg"></td>';
                echo 
'<td height="2"></td>';
                echo 
'<td height="2"><img src="cab-new.jpg"></td>';
             echo 
' </tr>';
              echo 
'<tr valign="top">';
            
///AQUI VA PRIMER NOT
             
echo ' <td marging-left:10; onMouseOver=this.style.background="#EEF7FF"; onMouseOut=this.style.background="";>';
            
////ABRE PRIMER NOTICIA
            
echo $row["fecha"];
            echo 
'<img src="date.gif">';
            echo 
'<font color="#585858" text-decoration:bold" size="3">';
            echo 
$row["titulo"];
            echo 
'</b><br>';
                                    
$imagen='<img src="'.$row["imagen"].'">';
            echo 
$imagen;
            echo 
'<br>';
            echo 
'</font>';
            echo 
$row["resumen"];
;
      echo
'<br>';
              echo 
' <a href="index2.php?proceso=1&widentificacion='.$row ["identificacion"].'">● noticia completa</a>';
              echo 
'<br>';
              echo 
'<br>';
      
///1CIERRA PRIMER NOTICIA

//            echo '<a href="index.php?cvenot='.$rownot["cvenot"].'&encuestaok='.$encuestaok.'">CONTINUAR...</a>';

//            echo '<form action="" method="post">';
//            echo '<input type="hidden" name="cvenot" value="'.$row["identificacion"].'">';
//            echo '<input type="hidden" name="proceso" value="'.$row["identificacion"].'">';
//            echo '<input type="submit" name="enviar" value="continuar" class="boton">'; 
//            echo '</form>';


            
echo '</font>';
            echo 
'</font>';
            echo 
'</div>';
            echo 
'</td>';
            
////DIVISION DE COLUMNA
             
echo'<td width="158">&nbsp;</td>';
             
////DIVISION DE COLUMNA
                 ///AQUI VA PRIMER NOT
                
}
                if(
$indi==1){
                
///AQUI VA SEGUNDA NOT
            
echo '<td onMouseOver=this.style.background="#EEF7FF"; onMouseOut=this.style.background="";>';
            echo 
$row["fecha"];
            echo 
'<img src="date.gif">';
            echo 
'<font color="#585858" text-decoration:bold" size="3">';
            echo 
$row["titulo"];
            echo 
'</b><br>';
                                    
$imagen='<img src="'.$row["imagen"].'">';
            echo 
$imagen;
            echo 
'<br>';
            echo 
'</font>';
            echo 
$row["resumen"];

//            echo '<a href="index.php?cvenot='.$rownot["cvenot"].'&encuestaok='.$encuestaok.'">CONTINUAR...</a>';
//            echo '<form action="" method="post">';
//            echo '<input type="hidden" name="cvenot" value="'.$row["identificacion"].'">';
//            echo '<input type="hidden" name="proceso" value="'.$row["identificacion"].'">';
//            echo '<input type="submit" name="enviar" value="continuar" class="boton">'; 
//            echo '</form>';

      
echo'<br>';
      echo
'$actionqty=$_POST['actionqty']';
              echo 
' <a href="index2.php?proceso=1&widentificacion='.$row ["identificacion"].'">● noticia completa</a>';
              echo 
'<br>';
            echo 
'</font>';
            echo 
'</div>';
            echo 
'<br>';
            echo 
'</td>';
            
///AQUI VA SEGUNDA NOT
            
echo '</tr>
              '
;
            echo 
'</table>';

}
            
///1CIERRA SEGUNDA NOTICIA

    
}
    } 
// cierra el while
$cuenta=$cuenta-1;
if (
$cuenta==5){$cuenta=4;}
echo 
'<table width="100%">';
echo 
'<tr>';
echo 
'<td>';
$tope=$cuenta +4;
echo 
'<div align="left">';
echo 
'<font size="4">';
echo 
' <a href="index2.php?cuenta='.$cuenta.'&tope='.$tope.'"><img src="back-new.jpg" border="0"></a>';
if (
$cuenta 6){echo '-';echo '<a href="javascript:history.go(-1)"><img src="avanzar-new.jpg" border="0" /></a>';}
echo 
'</font>';
echo 
'</div>
'
;
echo 
'</td>';
echo 
'</tr>';
echo 
'</table>';

/*
$cuenta=$cuenta-1;
if ($cuenta==13){$cuenta=12;}
echo '<table width="100%">';
echo '<tr>';
echo '<td>';
$tope=$cuenta +12;
echo '<div align="center">';
echo '<font size="3">';
if ($cuenta > 14){echo '<a href="javascript:history.go(-1)">Regresar</a> ::: ';}
echo ' <a href="index.php?cuenta='.$cuenta.'&tope='.$tope.'">Noticias Anteriores</a>';
echo '</font>';
echo '</div>';
echo '</td>';
echo '</tr>';
echo '</table>';
*/

?>
Se supone que ahí me muestra los títulos de las 4 ultimas noticias, pero al darle click en "noticia completa" debe de abrir la noticia que precisamente esta alojada en la BD, pero no hace nada, solo me refresca la página inicial.

Por fa necesito, me urge su ayuda, no tengo ni idea de que pasa o si tenga que pasar todo el código a PHP5...

Gracias !!!!
  #2 (permalink)  
Antiguo 29/01/2011, 02:34
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Sitio en PHP4 no funciona en PHP5 (porfa urge su ayuda)

El problema no creo que sea el cambio de version de tu PHP, me inclino a pensar que es mas bien porque en el hosting anterior tenias activo register_globals y en el actual no. Si estas en un servidor compartido no podras tener esa misma configuracion, por lo que la unica solucion seria declarar todas tus variables:

Código PHP:
Ver original
  1. $proceso = 0;
  2. if(isset($_GET['proceso'])) {
  3.     $proceso = $_GET['proceso'];
  4. }
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 29/01/2011, 02:57
 
Fecha de Ingreso: marzo-2007
Mensajes: 9
Antigüedad: 17 años, 1 mes
Puntos: 0
Respuesta: Sitio en PHP4 no funciona en PHP5 (porfa urge su ayuda)

Cita:
Iniciado por Triby Ver Mensaje
El problema no creo que sea el cambio de version de tu PHP, me inclino a pensar que es mas bien porque en el hosting anterior tenias activo register_globals y en el actual no. Si estas en un servidor compartido no podras tener esa misma configuracion, por lo que la unica solucion seria declarar todas tus variables:

Código PHP:
Ver original
  1. $proceso = 0;
  2. if(isset($_GET['proceso'])) {
  3.     $proceso = $_GET['proceso'];
  4. }
Hola, disculpa si te molesto, pero me puedes dar un ejemplo?
por que ya lo intente de varias formas y no me sale...

por ej.

Código PHP:
$proceso 0;
if(isset(
$_GET['proceso'])) {
echo 
' $proceso = <a href="index2.php?proceso=1&widentificacion='.$row ["identificacion"].'">● noticia completa</a>';


  #4 (permalink)  
Antiguo 29/01/2011, 23:36
 
Fecha de Ingreso: marzo-2007
Mensajes: 9
Antigüedad: 17 años, 1 mes
Puntos: 0
Respuesta: Sitio en PHP4 no funciona en PHP5 (porfa urge su ayuda)

ya lo resolví, gracias !

Etiquetas: Ninguno
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 22:17.