Tengo un login.php que se conecta a mi MySQL y cuando el login es correcto, va a index.php de mi joomla. El problema que tengo es que las sesiones no se pasan (logicamente), a ver si alguien sería tan amable de decirme como poder pasar esas sesiones y que cuando entre a joomla, el usuario continue logueado.
Muchas gracias!
index.php
Cita:
auth.php<!DOCTYPE html>
<?php
session_start();
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Login</title>
<link rel="stylesheet" href="login/subc_login/css/style.css">
</head>
<body>
<form method="post" action="auth.php" class="login">
<p>
<label for="login">Email:</label>
<input type="text" name="login">
</p>
<p>
<label for="password">Password:</label>
<input type="password" name="password">
</p>
<p class="login-submit">
<button type="submit" class="login-button">Login</button>
</p>
<p class="forgot-password"><a href="recupe_pass.php">Has olvidado la contraseña?</p></a>
</form>
</body>
</html>
<?php
session_start();
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Login</title>
<link rel="stylesheet" href="login/subc_login/css/style.css">
</head>
<body>
<form method="post" action="auth.php" class="login">
<p>
<label for="login">Email:</label>
<input type="text" name="login">
</p>
<p>
<label for="password">Password:</label>
<input type="password" name="password">
</p>
<p class="login-submit">
<button type="submit" class="login-button">Login</button>
</p>
<p class="forgot-password"><a href="recupe_pass.php">Has olvidado la contraseña?</p></a>
</form>
</body>
</html>
Cita:
conexion.php<?php
session_start();
require "conexion.php";
$login = $_POST["login"];
$password = $_POST["password"];
$password = sha1(md5($password));
$sql = "SELECT id FROM users WHERE email='$login' and password='$password'";
$rec = mysql_query($sql,$con) or die (mysql_error());
if($row = mysql_fetch_array($rec))
{
$_SESSION["id_username"] = $row['id'];
header("Location: http://www.estigiapp.com/joomla/index.php");
}
else
{
header("Location: http://www.estigiapp.com/index.php");
}
?>
session_start();
require "conexion.php";
$login = $_POST["login"];
$password = $_POST["password"];
$password = sha1(md5($password));
$sql = "SELECT id FROM users WHERE email='$login' and password='$password'";
$rec = mysql_query($sql,$con) or die (mysql_error());
if($row = mysql_fetch_array($rec))
{
$_SESSION["id_username"] = $row['id'];
header("Location: http://www.estigiapp.com/joomla/index.php");
}
else
{
header("Location: http://www.estigiapp.com/index.php");
}
?>
Cita:
<?php
$DB_SERVER = 'localhost';
$DB_NAME = 'EAPP';
$DB_USER = 'EU';
$DB_PASS = 'friendlyfire';
$con = mysql_connect($DB_SERVER,$DB_USER,$DB_PASS);
mysql_select_db($DB_NAME,$con) or die("Cannot select database");
?>
$DB_SERVER = 'localhost';
$DB_NAME = 'EAPP';
$DB_USER = 'EU';
$DB_PASS = 'friendlyfire';
$con = mysql_connect($DB_SERVER,$DB_USER,$DB_PASS);
mysql_select_db($DB_NAME,$con) or die("Cannot select database");
?>