Jump to content

Recommended Posts

hello phpfreaks

 

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

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

<?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 can see what to change?

 

 

thank you for your time :)

Link to comment
https://forums.phpfreaks.com/topic/197238-undifined-index/
Share on other sites

Use ISSET on the if ($_COOKIE) like shown for the GET variables.

 

isset tests if the variables isset, doing this will not throw the undefined index notice. So yea, take the logic that was given to you and apply it to the rest of the script on COOKIES / GET / POST variables that are coming in which may or may not exist.

Link to comment
https://forums.phpfreaks.com/topic/197238-undifined-index/#findComment-1035342
Share on other sites

Use ISSET on the if ($_COOKIE) like shown for the GET variables.

 

isset tests if the variables isset, doing this will not throw the undefined index notice. So yea, take the logic that was given to you and apply it to the rest of the script on COOKIES / GET / POST variables that are coming in which may or may not exist.

 

 

okay fixed some of it, but i still got this error.

Notice: A session had already been started - ignoring session_start() in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 2

Notice: Undefined index: r in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 11

Notice: Undefined index: ucNick in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 15

 

1 <?php
2 session_start();
/**********************************************************************************************************************************************

************************************************************************************************************************************************/
11 include "config.php";
12 global $loggedin;
13 if($_GET['r'])
{
$_SESSION['r'] = $_GET['r'];
}
$user = $_COOKIE['ucNick'];

 

 

hope you can help me again :)

Link to comment
https://forums.phpfreaks.com/topic/197238-undifined-index/#findComment-1035524
Share on other sites

okay fixed some of it, but i still got this error.

Notice: A session had already been started - ignoring session_start() in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 2

Notice: Undefined index: r in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 11

Notice: Undefined index: ucNick in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 15

 

Notice: A session had already been started - ignoring session_start() in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 2 = There is already a call to session_start(), this can be another script, or the server automatically starts the session.

 

Notice: Undefined index: r in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 11 = The key 'r' doesn't exist in the $_GET array.

 

Notice: Undefined index: ucNick in /www/zxq.net/p/a/i/paidtoclick/htdocs/data.php on line 15  = The key 'ucNick' doesn't exist in the $_COOKIE array.

Link to comment
https://forums.phpfreaks.com/topic/197238-undifined-index/#findComment-1035560
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.