Código PHP:
<?
session_start();
@ $db = mysql_pconnect("localhost", "root");
mysql_select_db("soft");
function quitar($mensaje)
{
$mensaje = str_replace("<","<",$mensaje);
$mensaje = str_replace(">",">",$mensaje);
$mensaje = str_replace("\'","'",$mensaje);
$mensaje = str_replace('\"',""",$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();
}
?>
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