Skip to main content

Overview

RALQ requires user authentication to access the platform’s AR chemistry learning features. This guide walks you through account registration, login, and session management.

Registration Process

1

Navigate to Registration

From the RALQ landing page (index.php), click the registration link to access the signup form at registro.php.
2

Complete Required Fields

The registration form requires the following information:
  • Nombre (First Name) - Your first name(s)
  • Apellido Paterno (Paternal Surname) - Required field
  • Apellido Materno (Maternal Surname) - Required field
  • Correo (Email) - Must be a valid email format
  • Contraseña (Password) - Your chosen password
  • Confirmar Contraseña (Confirm Password) - Must match your password
All fields are mandatory and validated before submission.
3

Submit Registration

Click the “Listo” (Ready) button to submit your registration. The form performs client-side validation:
  • Checks that all fields are filled
  • Validates email format using regex pattern
  • Ensures passwords match
  • Displays inline error messages if validation fails
4

Registration Confirmation

Upon successful registration, your account is created in the database with:
  • Hashed password for security
  • Unique user ID
  • Email stored for login authentication
The registration form uses JavaScript validation (validateForm() function) to provide immediate feedback before server-side processing.

Form Validation Rules

The registro.php form validates:
FieldValidation RuleError Message
NombreCannot be empty”El nombre es obligatorio.”
Apellido PaternoCannot be empty”El apellido paterno es obligatorio.”
Apellido MaternoCannot be empty”El apellido materno es obligatorio.”
EmailValid format ([email protected])“Correo electrónico inválido.”
PasswordCannot be empty”La contraseña es obligatoria.”
Confirm PasswordMust match password”Las contraseñas no coinciden.”
Error messages appear in red text below each field with visibility toggled based on validation status.

Login Process

1

Access Login Page

Navigate to iniciosesion.php from the homepage or registration page link (“¿Ya tienes cuenta? Inicia sesión”).
2

Enter Credentials

Provide your registered credentials:
  • Correo (Email) - The email used during registration
  • Contraseña (Password) - Your account password
3

Submit Login

Click the “Entrar” (Enter) button. The system processes authentication through php/log.php:
  1. Validates that email and password fields are not empty
  2. Queries the database for the email
  3. Verifies the password using password_verify() against the hashed password
  4. Creates a PHP session upon successful authentication
4

Session Initialization

On successful login:
  • $_SESSION['user_id'] is set with your unique ID
  • $_SESSION['user_email'] stores your email
  • You’re redirected to menu.php (main dashboard)

Login Error Handling

Common login errors include:
  • “El correo no está registrado.” - Email not found in the database
  • “Contraseña incorrecta.” - Password doesn’t match the stored hash
  • “El correo electrónico es obligatorio.” - Empty email field
  • “La contraseña es obligatoria.” - Empty password field
Error messages are displayed below the relevant input field in red text.

Session Management

Active Session

Once logged in, RALQ maintains your session across pages using PHP session handling:
  • Session Start: Every protected page begins with session_start()
  • User Identification: Your email is displayed in the header dropdown
  • Persistent Access: Session remains active until logout or browser closure

User Profile Access

In the header navigation (menu.php:43-50), you’ll find:
Click the user icon in the top-right header to access:
  • Your Email: Displayed in bold (from $_SESSION['user_email'])
  • Cerrar sesión: Logout button that ends your session
The user dropdown menu is toggled by clicking the user icon, which triggers the toggleMenu() JavaScript function defined in js/usuario.js.

Session Security

RALQ implements several security measures:
  1. Password Hashing: Passwords are hashed using PHP’s password_hash() function
  2. Prepared Statements: SQL queries use prepared statements to prevent injection
  3. Session Validation: Protected pages check for active session before rendering content
  4. Secure Redirect: Failed authentication redirects back to login with error messages

Account Security Best Practices

  • Use a strong, unique password for your RALQ account
  • Avoid reusing passwords from other platforms
  • Consider using a password manager
  • Include a mix of letters, numbers, and special characters
  • Always log out when using shared computers
  • Don’t share your login credentials
  • Close your browser after logging out on public devices
  • Be aware that sessions may persist until browser closure
  • Use a valid, active email address
  • Ensure you have access to the registered email
  • Keep your email account secure as it’s your login identifier

Logout Process

To safely end your RALQ session:
1

Open User Menu

Click the user icon in the top-right corner of the header to expand the dropdown menu.
2

Click Logout

Select “Cerrar sesión” from the dropdown menu.
3

Session Termination

You’ll be redirected to index.php (homepage) and your session variables are cleared:
  • $_SESSION['user_id'] is unset
  • $_SESSION['user_email'] is unset
  • Session data is destroyed
After logout, you’ll need to log in again to access molecular structures, laboratories, and AR features.

Troubleshooting

Can’t Register

Problem: Form won’t submit or shows validation errorsSolutions:
  • Ensure all fields are filled completely
  • Check that email format is valid (must contain @ and domain)
  • Verify that passwords match exactly
  • Clear browser cache and try again
  • Disable browser autofill if it’s causing conflicts

Can’t Login

Problem: “Contraseña incorrecta” or “El correo no está registrado”Solutions:
  • Double-check email spelling
  • Verify Caps Lock is off for password entry
  • Ensure you completed registration successfully
  • Try re-registering if you’re unsure about account status
  • Contact support via [email protected] if issues persist

Session Expires Unexpectedly

Problem: Logged out unexpectedly or redirected to loginSolutions:
  • Check if browser is blocking cookies
  • Ensure browser supports PHP sessions
  • Don’t open multiple tabs with different users
  • Clear browser cookies and re-login
  • Avoid very long idle periods

Database Connection

For administrators and developers, RALQ uses the following database configuration (from php/log.php):
$servername = "localhost";
$username = "root";
$password = "1234";
$dbname = "registro_RALQ";
User data is stored in the usuarios table with fields:
  • id - Unique user identifier
  • email - User email (login identifier)
  • password - Hashed password
  • Additional profile fields from registration

Next Steps

Once your account is set up and you’re logged in:

Build docs developers (and LLMs) love