Ok, I tried to make a login page for my clan site, yet get this error:
Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
However, (at least in FireFox), when trying to log in again, it doesn't show...
I've had a look at a few other threads, and it looks like I shouldnt be using session_register() as I do...someone said the following:
Weedpacket wrote:You're not still using session_register() are you?
session_start();
$_SESSION['variable']=$data_on_first_page;
session_start();
$data_on_second_page = $_SESSION['variable'];
Is so much simpler.
However, how I put it onto my page I don't get...this is the page:
<? if (!$_POST['name2'] || !$_POST['pass2']) {
echo "Please fill out all fields.";
exit;
}
$name = $_POST['name2'];
$pass = $_POST['pass2'];
include("config.php");
$logres = @mysql_num_rows(mysql_query("select * from members where name='$name' and pass='$pass'"));
if ($logres <= 0) {
echo "Login failed. If you have authority to log in, please check your spelling and try again.";
exit;
} else {
session_register("name");
session_register("pass");
include ("settings.php");
$grouppermissions = mysql_query("SELECT * FROM members WHERE name='$name' AND pass='$pass'");
while ($group = mysql_fetch_array($grouppermissions)){
echo "Welcome, $name <br>";
if ($group[group] == "Admin") {
include("adminoptions.php");
} ;
} ;
} ;
?>
Any help would be greatly appreciated :-)