Jump to content


Photo

RE: $_SESSION error on newsbox script


  • Please log in to reply
1 reply to this topic

#1 pinkychukkles

pinkychukkles
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 07 May 2006 - 09:55 PM

[!--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
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");
but there is also some script on the admin.php file where it authenticates the user, that code is
// ----------------------------------------------------------------------
// 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"];
        }
    }
}

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--]

#2 pinkychukkles

pinkychukkles
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 09 May 2006 - 10:20 AM

[!--fonto:Arial--][span style=\"font-family:Arial\"][!--/fonto--]Now I think 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--]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users