Documentation Index
Fetch the complete documentation index at: https://mintlify.com/wreyesus/Sencillo_Carrito_de_Compras_en_PHP/llms.txt
Use this file to discover all available pages before exploring further.
index.php is the entry point for the YUME|TEC store. It renders the main homepage — complete with a banner, a featured products image, and the site’s primary navigation — and also handles member authentication via a jQuery-powered slide-down panel anchored to the very top of every page. When a visitor submits valid credentials, the script writes session variables and redirects them to index2.php, the authenticated version of the homepage.
How the login panel works
The sliding login panel is built around twodiv elements nested inside #toppanel: the #panel container holds the login form itself, and the .tab container exposes the toggle button that the user clicks to reveal it. The panel begins collapsed; js/slide.js listens for clicks on #open and animates div#panel downward with jQuery’s slideDown("slow"). A matching click on #close calls slideUp("slow") to retract it.
js/slide.js and is loaded after jQuery 1.3.2:
jquery-1.7.1.min.js from the project root and js/jquery-1.3.2.min.js from the js/ sub-directory. slide.js depends on 1.3.2 and must be loaded after it.
Authentication flow
When the visitor fills in the login form and clicks Entrar, the browser POSTslog (username) and pwd (password) to index2.php (the form’s action attribute). index2.php detects $_POST['log'], queries the usuario table, and on success writes two session keys before issuing a redirect.
$_SESSION['idusuario'] stores the numeric primary key from the usuario table, and $_SESSION['usuario'] stores the plaintext nickname. Both are used by subsequent pages to identify the logged-in member.
Session-aware navigation
The tab bar inside#toppanel checks $_SESSION['usuario'] to personalise the greeting and the action button on every page:
#panel login form is replaced by a plain Cerrar Sesion link pointing to cerrar_sesion.php, which destroys the session and returns the visitor to the guest state.
Navigation links
The#nav unordered list provides the five top-level links available from index.php. Logged-in users land on index2.php after authentication, which mirrors this navigation but points Inicio back to index2.php instead.
| Label | Target file | Purpose |
|---|---|---|
| Inicio | index.php | Homepage — featured products and banner |
| Nosotros | nosotros.php | About page for the YUME|TEC team |
| Productos | categorias.php | Category landing page for all product lines |
| Contacto | contacto.php | Contact form powered by PHPMailer |
| Carrito | carrito.php | Shopping cart — view and edit pending items |