Help - Search - Members - Calendar
Full Version: Cant Find The Out Whats Wrong?
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
kohoved
hello zymic

i have this script that i cant get working, im a really noob at php, but i tried.
now i have come to ask for you help.

i get these errors

Notice: Undefined index: usNick in /www/zxq.net/p/a/i/xxxxxxx/htdocs/config.php on line 16
Notice: Undefined index: usNick in /www/zxq.net/p/a/i/xxxxxxx/htdocs/config.php on line 39
Notice: A session had already been started - ignoring session_start() in /www/zxq.net/p/a/i/xxxxxxx/htdocs/data.php on line 2
Notice: Undefined index: usNick in /www/zxq.net/p/a/i/xxxxxxx/htdocs/config.php on line 16
Notice: Undefined index: usNick in /www/zxq.net/p/a/i/xxxxxxx/htdocs/config.php on line 39
Notice: Undefined index: r in /www/zxq.net/p/a/i/xxxxxxx/htdocs/data.php on line 11
Notice: Undefined index: ucNick in /www/zxq.net/p/a/i/xxxxxxx/htdocs/data.php on line 15


of what i can see its something about usNick but i cant find out what?


config.php
CODE
<?php
/********************************************************************************
**************************************************************
            SecureBux Version 2.00
    This Script has been created and coded by Gabrola and sold by Hamza.
    If you find any bugs in the script report at ygabrola@gmail.com or contact Hamza.
    Copywrite Gabrola 2008;
********************************************************************************
****************************************************************/
$dhost = "localhost"; //usually localhost, or ip
$dusername = "xxxxxxxxxx"; // database user
$dpassword = "xxxxxxxxx"; // database pass
$ddatabase = "xxxxxxxxx"; // database name

$con = mysql_connect($dhost, $dusername, $dpassword) or die("Cannot Connect");
mysql_select_db($ddatabase, $con);

if($_COOKIE["usNick"] and $_COOKIE["usPass"])
{
$q = mysql_query("SELECT * FROM tb_users WHERE username='{$_COOKIE['usNick']}' AND password='{$_COOKIE['usPass']}'") or die(mysql_error());
if(mysql_num_rows($q) == 0)
{
$_COOKIE['usNick'] = false;
$_COOKIE['usPass'] = false;
} else {
$loggedin = 1;
$r = mysql_fetch_array($q);
}
}
$da = date("j");

    $queryxx = "DELETE FROM ad_clicks WHERE day!='$da'";
mysql_query($queryxx);

$q2 = mysql_query("SELECT * FROM settings");
while($r2=mysql_fetch_array($q2))
{
$set[$r2["setname"]]=$r2["setvalue"];
}
mysql_query("UPDATE settings SET setvalue='0', set_day='{$da}' WHERE set_day!='{$da}' AND set_day>'0'") or die(mysql_error());
$user=$_COOKIE['usNick'];
?>




data.php
CODE
<?php
session_start();
/********************************************************************************
**************************************************************
            SecureBux Version 2.00
    This Script has been created and coded by Gabrola and sold by Hamza.
    If you find any bugs in the script report at ygabrola@gmail.com or contact Hamza.
    Copywrite Gabrola 2008;
********************************************************************************
****************************************************************/
include "config.php";
global $loggedin;
if($_GET['r'])
{
$_SESSION['r'] = $_GET['r'];
}
$user = $_COOKIE['ucNick'];



anyone who can see whats wrong?


thank you for your time smile.gif
swordz
As the error clearly says, it's using undefined indicies, or variables.

Swordz
kohoved
QUOTE(swordz @ Apr 1 2010, 11:00 AM) *
As the error clearly says, it's using undefined indicies, or variables.

Swordz



i can read that, but i cant seem to find the problem.
swordz
Start at the top with a blank sheet of paper.
Methodically go through the code.
Write down what variables are used, and what they are.
If at any point you try to use a variable that you haven't yet defined, that's your issue.

Swordz
kohoved
QUOTE(swordz @ Apr 1 2010, 09:25 PM) *
Start at the top with a blank sheet of paper.
Methodically go through the code.
Write down what variables are used, and what they are.
If at any point you try to use a variable that you haven't yet defined, that's your issue.

Swordz


okay thank you very much, found the problem smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.