Jump to content

Help with sessions


jdm95lude

Recommended Posts

Small edit to master's code. He forgot to add the session_start. You will need that at the very top of each page that uses sessions.

 

<?php
session_start(); // required before any output for sessions.
// run your checks on the values, make sure something was entered etc...

// then store the info into session vars
$_SESSION['user'] = $_POST['user'];

// use your session var
echo $_SESSION['user'];
?>

Link to comment
https://forums.phpfreaks.com/topic/137276-help-with-sessions/#findComment-717276
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.