Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2008, 11:32
poti84
 
Fecha de Ingreso: mayo-2008
Mensajes: 7
Antigüedad: 16 años
Puntos: 0
error con funcion de autentificación

Hola me sale un error cuando utilizo mi funcion de autentificación:

Código PHP:
<?
session_start
();

$db mysql_pconnect("localhost""root");

mysql_select_db("soft");
    
 function 
quitar($mensaje
    { 
        
$mensaje str_replace("<","&lt;",$mensaje); 
        
$mensaje str_replace(">","&gt;",$mensaje); 
        
$mensaje str_replace("\'","'",$mensaje); 
        
$mensaje str_replace('\"',"&quot;",$mensaje); 
        
$mensaje str_replace("\\\\","\",$mensaje); 
        return $mensaje; 
    } 
 
if($_POST["
login"] != "" && $_POST["password"] != "")
{  
    $loginN = quitar($_POST["
login"]); 
    $passN = quitar($_POST["
password"]); 
        
    $result = mysql_query("
SELECT pass FROM socio WHERE login='".$loginN."'"); 
    if($row = mysql_fetch_array($result)) 
    { 
        if($row["
pass"] == $passN) 
        { 
            $valid_user = $_POST["
login"];
            //session_register( "
valid_user" );
            $_SESSION['valid_user'] = $valid_user;
        } 
      } 
}
 
if ( session_is_registered( "
valid_user" ) )

    if ($_SESSION['valid_user'] == "
admin")  
    { ?> 
        <SCRIPT LANGUAGE="
javascript"> 
        target = "
_top";    
        window.open('./admin/index.php',target,defaultStatus,'fullscreen=1','width=768','height=1024');                
        </SCRIPT> 
    <? }
    else  { ?>
        <SCRIPT LANGUAGE="
javascript"> 
        target = "
_top";    
        window.open('./socio/index.php',target,defaultStatus,'fullscreen=1','width=768','height=1024');                
        </SCRIPT> 
    <? } 
}
else if ( isset( $_POST["
password"]) )
{
  ?>
    <script LANGUAGE="
javascript">                
    target = "
_top";
    window.open('./index.php',target,defaultStatus,'fullscreen=1','width=768','height=1024');
    window.alert("
No te has registrado correctamente");
    </script>
                
  <?
   session_destroy();
}
 
else 
{
 ?>
    <script LANGUAGE="
javascript">
    target = "
_top";
    window.open('./index.php',target,defaultStatus,'fullscreen=1','width=768','height=1024');
    window.alert("
No estás registrado");
    </script>
  <?
  
   session_destroy();
}
 
?>
me sale el siguiente error:

Fatal error: Call to undefined function session_is_registered() in D:\AppServ\www\pc\soft\autentificacion.php on line 35


Según he leido debo de quitar el session_is_registered por estar obsoleto (utilizo php 6.0, pero no sé como modificarlo :(

alguien me podría ayudar?

un saludo y gracias