Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default PowerPanel Help 2

    I cant remove requests i get this thing come up

    HTML Code:
     Fatal error:  Call to undefined function: checkaccount() in /home/thebobba/public_html/djpanel/delreq.php on line 6
    This is that file


    PHP Code:
    <?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();
    }
    ?>
    +rep for help

  2. #2
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Can i see the functions.php file and the config.php file please.
    James


    Connected to reality through a proxy server.

  3. #3
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    Sure


    Functions
    PHP Code:
    <?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) {

            
    $filter strlen($bad);
                    

            
    $string str_replace($bad"*****"$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('[b]'"<strong>"$string);
    $string str_replace("[/b]""</strong>"$string);
    $string str_replace("[u]""<u>"$string);
    $string str_replace("[/u]""</u>"$string);
    $string str_replace("[i]""<i>"$string);
    $string str_replace("[/i]""</i>"$string);
    $string str_replace("[s]""<strike>"$string);
    $string str_replace("[/s]""</strike>"$string);
    $string str_replace("[code]"'<div style="margin-left: 5px; margin-top: 5px;">Code:<br /><div style="border: dotted 1px #000000; padding: 4px;"><!-- Code -->'$string);
    $string str_replace("[/code]""<!-- / 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("[quote]"'<div style="margin-left: 5px; margin-top: 5px;">Quote:<br /><div style="border: dotted 1px #000000; padding: 4px;"><!-- Quote -->'$string);
    $string str_replace("[/quote]""<!-- / 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;
    }
    }

    ?>
    Config

    PHP Code:
    <?php

    $hostname 
    "localhost";
    $username "thebobba_panel";
    $password "panel";
    $database "thebobba_panel";

    $connect mysql_connect($hostname$username$password$database) or die('Could not connect to MySQL Database, Error: 'mysql_error());
    $dbselect mysql_select_db($database$connect) or die('Could not select MySQL Database, Error: 'mysql_error());

    $siteinfo mysql_query("SELECT * FROM config");
    $site mysql_fetch_array($siteinfo);

    $hometext $site[home];
    $hometext nl2br($hometext);

    ?>

    Ok?

  4. #4
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    You need to replace the code in config.php with:

    Code:
    <?php
    include('functions.php');
    
    $hostname = "localhost";
    $username = "thebobba_panel";
    $password = "panel";
    $database = "thebobba_panel";
    
    $connect = mysql_connect($hostname, $username, $password, $database) or die('Could not connect to MySQL Database, Error: '. mysql_error());
    $dbselect = mysql_select_db($database, $connect) or die('Could not select MySQL Database, Error: '. mysql_error());
    
    $siteinfo = mysql_query("SELECT * FROM config");
    $site = mysql_fetch_array($siteinfo);
    
    $hometext = $site[home];
    $hometext = nl2br($hometext);
    
    ?>
    James


    Connected to reality through a proxy server.

  5. #5
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    Thx +rep!

  6. #6
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    Sorry duble post its just white now :S http://www.thebobbas.net/djpanel/

  7. #7
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Ok, take the

    PHP Code:

    include('functions.php'); 
    Out of config and add it into the file you originally got an error from.Below:

    PHP Code:
    session_start(); 
    Last edited by Mr Macro; 31-05-2007 at 12:21 PM.
    James


    Connected to reality through a proxy server.

  8. #8
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    Read post above

  9. #9
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Quote Originally Posted by Jamieb View Post
    Read post above
    Yeah, i replied to that.Read above
    James


    Connected to reality through a proxy server.

  10. #10
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    done that.. now i carnt remove requests agen

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •