Page 1 of 1

Undefined index: dbname in /usr/local/mysar/www/install/inde

Posted: Fri Nov 18, 2011 3:23 am
by tshepang.moagi
Hi All

Please assist,i've never done any php work before.SO i'm trying to install mysar i'm getting the following error.

[text]Notice: Undefined index: dbname in /usr/local/mysar/www/install/index.php on line 68 Notice: Undefined index: dbname in /usr/local/mysar/www/install/index.php on line 69 Notice: Undefined index: dbname in /usr/local/mysar/www/install/index.php on line 70 Notice: Undefined index: dbname in /usr/local/mysar/www/install/index.php on line 167 Notice: Undefined index: dbuser in /usr/local/mysar/www/install/index.php on line 167 Notice: Undefined index: dbhost in /usr/local/mysar/www/install/index.php on line 167 Notice: Undefined index: dbpass in /usr/local/mysar/www/install/index.php on line 167 [/text]

Below this is how my index.php looks like

Code: Select all

<?php
# Program: mysar, File: www/index.php
# Copyright 2004-2006, Stoilis Giannis <giannis@stoilis.gr>
#
# This file is part of mysar.
#
# mysar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# mysar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Foobar; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

// This is needed later on...
set_time_limit(0);

function db_check($result,$step=1) {

        global $queries1;
        global $queries2;

        if($result==FALSE) {
                echo "Failed...";
                echo "<br>".mysql_error();
                echo '<p><a href="index.php?install=new'.$step.'">Click here to try again!</a>';

                switch($step) {
                        case '3':
                                echo "<p>Sorry, but I couldn't verify your database setup!";
                                exit();

                                break;
                        default:
                                echo "<p>Sorry, but I couldn't complete the database setup myself. Here are the commands, so that you can run them for youself. If you complete this step by yourself, <a href=\"./?install=new3\">click here</a> to test the connection and continue the installation.";
                                echo "<br><pre>";

                                reset($queries1);
                                while(list($key,$value)=each($queries1)) {
                                        echo "\n".$value;
                                }//while(list($key,$value)=each($queries1)) {

                                reset($queries2);
                                while(list($key,$value)=each($queries2)) {
                                        echo "\n".$value;
                                }//while(list($key,$value)=each($queries2)) {

                                reset($queries1);
                                while(list($key,$value)=each($queries3)) {
                                        echo "\n".$value;
                                }//while(list($key,$value)=each($queries3)) {

                                reset($queries5);
                                while(list($key,$value)=each($queries5)) {
                                        echo "\n".$value;
                                }//while(list($key,$value)=each($queries5)) {

                                exit();
                }//switch($step) {
        }//if($result==FALSE) {
}

[b]Line 68::::$queries2[]='DROP DATABASE IF EXISTS '.$_REQUEST['dbname'].';';
Line 69::::$queries1[]='CREATE DATABASE '.$_REQUEST['dbname'].';';
$queries1[]='USE '.$_REQUEST['dbname'].';';[/b]
$queries2[]="
CREATE TABLE IF NOT EXISTS config (
  name varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',

Please assist.

My dbname is mysar
My dbhost is localhost

Re: Undefined index: dbname in /usr/local/mysar/www/install/

Posted: Fri Nov 18, 2011 6:08 am
by Celauran
You're getting this notice because you're trying to access a variable that may not have been set.

Code: Select all

$_REQUEST['dbname'] = (isset($_REQUEST['dbname'])) ? $_REQUEST['dbname'] : '';

Re: Undefined index: dbname in /usr/local/mysar/www/install/

Posted: Thu Nov 24, 2011 12:58 am
by tshepang.moagi
Thanks.