Jump to content

RE: $_SESSION error on newsbox script


Recommended Posts

[!--fonto:Arial--][span style=\"font-family:Arial\"][!--/fonto--]G'day,
I'm running Win XP (SP2) & PHP Version 5.1.2

I've done some extensive searching on the net, this board and others but can't find what the problem is. It must be something really simple (I hope!).

I downloaded a newsbox script from [a href=\"http://www.squidfingers.com\" target=\"_blank\"]squidfingers.com[/a], installed it on the root directory for a website I'm designing on my own machine but I get the following error whilst running the install.php script:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Notice: Undefined index: SESSION_USER in C:\Documents and Settings\Pinky\My Documents\TipTop3.0\admin\install.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at C:\Documents and Settings\Pinky\My Documents\TipTop3.0\admin\install.php:7) in C:\Documents and Settings\Pinky\My Documents\TipTop3.0\admin\install.php on line 8[/quote]

The code is refers to from the install.php script is [code]require_once ("../includes/configure.php");

session_start ();
if ($_SESSION["SESSION_USER"] != $config["admin_username"]) {
    header ("Location: index.php");
    exit;
}

require_once ("../includes/admin.php");
require_once ("../includes/connect.php");[/code]but there is also some script on the admin.php file where it authenticates the user, that code is [code]// ----------------------------------------------------------------------
// Authenticate User

function admin_login () {
    global $config;
    session_start ();
    if (empty ($_SESSION["SESSION_USER"])) {
        $username = $_REQUEST["username"];
        $password = $_REQUEST["password"];
        if ($username != $config["admin_username"] || $password != $config["admin_password"]) {
            print_admin_header ();
            print_admin_login ((empty ($username) && empty ($password)) ? "Please Login." : "Incorrect Username or Password.");
            print_admin_footer ();
            exit;
        } else {
            $_SESSION["SESSION_USER"] = $config["admin_username"];
        }
    }
}[/code]

Someone on another website where I went to for advice, suggested it could be because my register_globals was set to ON in the ini.php file but that's not the case as it's defaulted to OFF. I'm wondering whether it could just be a setting on my localhost.

Any help much appreciated.
Thanks,
pinky[!--fontc--][/span][!--/fontc--]
Link to comment
Share on other sites

[!--fonto:Arial--][span style=\"font-family:Arial\"][!--/fonto--]Now I [i]think[/i] I've got it almost licked, after feeling like I've been bashing my head against a php wall for the past few days. It's something probably to do with the settings in my php.ini file, with sessions and possibly a bit of permission problems thrown in.

Basically my flatmate who runs Win2k & php4.3.1 had it working first time on his pc, so I un-installed php5.1.2 on my pc and installed the older version, grabbed a copy of his php.ini file et voilá! I got the admin login screen...but now I can't connect to my database but suspect that again that could be down to some settings in the php.ini file to do with MySQL but hoping to nail that tonight.

If this smacks of a total common problem with a simple setting within php.ini or I've totally missed the point, please let me know! Thanks.[!--fontc--][/span][!--/fontc--]
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.