PDA

View Full Version : Power Panel Problem.



HabbDance
23-11-2008, 09:48 PM
Ok, so I'm using power panel, and when I try to delete a request I get this:

Fatal error: Call to undefined function: checkaccount() in /homepages/34/d237406810/htdocs/wsb4850525601/powerpanel/delreq.php on line 7

delreq.php

<?php
session_start();
include("includes/config.php");

if(isset($_SESSION['username']) && isset($_SESSION['password']) && $_SESSION['level']) {

checkaccount($_SESSION[username]);

$id = $_GET['id'];

$query = mysql_query("DELETE FROM requests WHERE id = '$id'") or die('Could not delete request: '.mysql_error());

echo("<br /><center><strong>Request deleted!</strong> Please reload this page</center>");

die();
}
?>


Any ideas? +rep will be given.

Joe!
23-11-2008, 09:49 PM
Post the config file as i'm assuming that will/should include the function or a functions file. If it does include a funtions file, post that as well.

L?KE
23-11-2008, 09:50 PM
The function check account on line 7 has not been defined anyway, is what it is saying.

Excellent2
23-11-2008, 09:51 PM
Yeah, post the config as there will be the functions in there. It's basically a problem with the checkaccount(); function.

HabbDance
23-11-2008, 09:52 PM
config.php is blank?

Here is the functions file:


<?php
include("config.php");

function clean($string) {
$string = htmlspecialchars($string);
$string = stripslashes($string);
$string = mysql_escape_string($string);
$string = htmlentities($string);
$string = str_replace("\"", "", $string); // Don't ask why after I did stripslashes() [:
$string = str_replace(">", "", $string);
$string = str_replace("<", "", $string);
return $string;
}

function censor($string) {
## We need to censor the text
#################################

$words = file_get_contents("http://powerpanel.duosystems.net/grab/swears.txt");

$wordz = explode("|", $words);

foreach($wordz as $bad) {

$string = str_replace($bad, "*****", strtolower($string));

}

return $string;

#################################
## Censored!
}

function encrypt($string) {
$string = md5($string);
$string = base64_encode($string);
$string = md5($string);
$string = base64_decode($string);
$string = md5($string);
return $string;
}

// Email address valid checker
function check_email_address($email) {
// First, we check that there's one @ symbol, and that the lengths are right
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
return false;
}
// Split it into sections to make life easier
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++) {
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
return false;
}
}
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2) {
return false; // Not enough parts to domain
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
return false;
}
}
}
return true;
}

## BBCode
function bbcode($string) {
$string = str_replace('', "<strong>", $string);
$string = str_replace("", "</strong>", $string);
$string = str_replace("", "<u>", $string);
$string = str_replace("", "</u>", $string);
$string = str_replace("", "<i>", $string);
$string = str_replace("", "</i>", $string);
$string = str_replace("", "<strike>", $string);
$string = str_replace("", "</strike>", $string);
$string = str_replace("
", '<div style="margin-left: 5px; margin-top: 5px;">Code:<br /><div style="border: dotted 1px #000000; padding: 4px;"><!-- Code -->', $string);
$string = str_replace("", "<!-- / Code --></div></div>", $string);

if(@preg_match("/<div style=\"margin-left: 5px; margin-top: 5px;\">Code:<br /><div style=\"border: dotted 1px #000000; padding: 4px;\"><!-- Code -->/i", $string) && !@preg_match("/<!-- / Code --></div></div>/i", $string)) {
$string = "". $string ."</div></div>";
}

$string = str_replace("
", '<div style="margin-left: 5px; margin-top: 5px;">Quote:<br /><div style="border: dotted 1px #000000; padding: 4px;"><!-- Quote -->', $string);
$string = str_replace("", "<!-- / Quote --></div></div>", $string);

if(@preg_match("/<div style=\"margin-left: 5px; margin-top: 5px;\">Quote:<br /><div style=\"border: dotted 1px #000000; padding: 4px;\"><!-- Quote -->/i", $string) && !@preg_match("/<!-- / Quote --></div></div>/i", $string)) {
$string = "". $string ."<!-- / Quote --></div></div>";
}

return $string;
}

function checkaccount($username) {

$user = $username;

$check = @mysql_num_rows(mysql_query("SELECT * FROM users WHERE username = '$user'"));

if($check == "0") {
session_destroy();
die();
return;
}
else {
return;
}
}

?>

Excellent2
23-11-2008, 10:02 PM
On delreq.php does it have

<?php include("includes/functions.php"); ?>
If not add it as it's not picking up that function.

Joe!
23-11-2008, 10:04 PM
On delreq.php does it have

<?php include("includes/functions.php"); ?>
If not add it as it's not picking up that function.
It might be including it in the config file, that's why I asked him to post the config file, ignored though :rolleyes:

Excellent2
23-11-2008, 10:06 PM
It might be including it in the config file, that's why I asked him to post the config file, ignored though :rolleyes:He said it was blank though.

Joe!
23-11-2008, 10:08 PM
Ah touche. Didn't see that bit. Surely it shouldn't be blank? If it is, that's obviously what's causing the problem..

HabbDance
23-11-2008, 10:09 PM
He said it was blank though.
Thank you.


It might be including it in the config file, that's why I asked him to post the config file, ignored though :rolleyes:
Stated it was blank.


On delreq.php does it have

<?php include("includes/functions.php"); ?>
If not add it as it's not picking up that function.
AH THANKS :D WORKED A CHARM +rep
Edit: Need to spread. I'll add you in my sig. My list is getting quite long :D

Excellent2
23-11-2008, 10:12 PM
AH THANKS :D WORKED A CHARM +rep
Edit: Need to spread. I'll add you in my sig. My list is getting quite long :DNo problem. Of course you could just add that on the config file but it'd be pointless :P

Want to hide these adverts? Register an account for free!