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
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']);

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.