Jump to content

[SOLVED] php.ini question


obewan

Recommended Posts

Hi

 

We just set up a CentOS box, php 4.3.9, and I am having trouble getting sessions running. My login script uses sessions so this is a problem.  I've played around with php.ini but sessions arent working. 

 

Here is how I am registering session vars (which works in 4.3.6)

 

$_SESSION['admin'] = true;

$_SESSION['username'] = $usename;

 

Any ideas?

 

 

Link to comment
https://forums.phpfreaks.com/topic/48287-solved-phpini-question/
Share on other sites

Yes, I do.  My script runs fine on the server running php 4.3.6 but it isn't running on server with php 4.3.9

 

Here is complete login script

 

<?php
session_start();
include('include/functions.php');

$username = $_POST["username"];
$password = $_POST["password"];

// check and see if they entered any info

   if($_POST["username"] == "")
   {
      header('Location: index.php');
   }

// establish database connection

connect_db();
$password = md5($password);

    $query = "select count(*) from ". ADMIN ." where username = '$username' and password = '$password'";
    $result = mysql_query( $query );
    $count = mysql_result( $result, 0, 0 );
    
    if($count < 1)
    {
include('index.php');
      	exit;
    }

$_SESSION['admin'] = true;
$_SESSION['username'] = $usename;
header("Location:". $_SERVER['HTTP_REFERER']);

?>

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.