Register for your free account! | Forgot your password?

Go Back   elitepvpers › MMORPGs › Last Chaos › Last Chaos Private Server
You last visited: Today at 03:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



CMS 3.8.2 Online_shop.php error HELP

Discussion on CMS 3.8.2 Online_shop.php error HELP within the Last Chaos Private Server forum part of the Last Chaos category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2017
Posts: 7
Received Thanks: 0
Question CMS 3.8.2 Online_shop.php error HELP

Your current cash: Error


Cant select database!


online_shop.php
PHP Code:
<?php
  header
("refresh:10;url=./index.php"); //auskommentieren falls Funktion benötigt wird
    
session_start();
    
$file = 'online_shop';
    include 
"config/config.php";
    include 
"styles/style.php";
    include 
"core/plugin.php";
    include 
'core/functions.php';
    include 
'core/classes.php';
    include 
'core/post_check.php';
    include 
"core/core.php";
    
$tpl->assignGlobal("page_title", "Cash Market");

    if( 
$User->LoggedIn == true )
    {
        
$mode = "";
        if(isset(
$_GET['mode'])) $mode=$_GET['mode'];
        
$Ctrl = new statpts();
        
$uid = $User->ID;
        
$userid = $uid;
            
        
$tpl->newBlock('online_shop');
        
$cashvalue = sprintf("SELECT cash FROM %s.bg_user WHERE user_code=$userid", $CMS_LCAuth);
             
$query = mysql_query($cashvalue);
           
$mycash = 'Error';
        if(
$row = mysql_fetch_assoc($query))
        {
            
$mycash = $row['cash'];    
        }
        
$tpl->Assign('mycash' , $mycash);
        if(
$mycash != "Error")
        {
            if(
$mode == "specialname")
            {
                
$charnames = array();
                
$valuenum = "";
                
$command = sprintf("SELECT a_nick FROM %s.t_characters WHERE a_user_index=$userid", $CMS_LCDb);
                
$query = mysql_query($command);
                while(
$row = mysql_fetch_assoc($query))
                {
                    
$charnames[] = $row['a_nick'];    
                }
                
$result = count($charnames);
                
$radiochar = '<u>Please select a character:<br></u>';
                for(
$forloop=0;$forloop<$result;$forloop++)
                {
                    
$checked = "";
                    if(
$forloop=="0")$checked = " checked";
                    
$radiochar .= '<input type="radio" name="charname" value="'.$charnames[$forloop].'"'.$checked.'>'.$charnames[$forloop].'<br>';
                }
                
$tpl->newBlock('specialname');
                
$tpl->Assign('radiochar', $radiochar);
            }
            else if(
$mode == "specialnameextended")
            {
                
$charnames = array();
                
$valuenum = "";
                
$command = sprintf("SELECT a_nick FROM %s.t_characters WHERE a_user_index=$userid", $CMS_LCDb);
                
$query = mysql_query($command);
                while(
$row = mysql_fetch_assoc($query))
                {
                    
$charnames[] = $row['a_nick'];    
                }
                
$result = count($charnames);
                
$radiochar = '<u>Please select a character:<br></u>';
                for(
$forloop=0;$forloop<$result;$forloop++)
                {
                    
$checked = "";
                    if(
$forloop=="0")$checked = " checked";
                    
$radiochar .= '<input type="radio" name="charname" value="'.$charnames[$forloop].'"'.$checked.'>'.$charnames[$forloop].'<br>';
                }
                
$tpl->newBlock('specialnameextended');
                
$tpl->Assign('radiochar', $radiochar);
            }
            else if(
$mode == "buysn")
            {
                
$toadd = '';
    
                if(isset(
$_POST["submitbutt1"])) $toadd = '£É';
                if(isset(
$_POST["submitbutt2"])) $toadd = '£Æ';
                if(isset(
$_POST["submitbutt3"])) $toadd = '£Ç';
                if(isset(
$_POST["submitbutt4"])) $toadd = '£Ê';
                if(isset(
$_POST["submitbutt5"])) $toadd = '£Ë';
                if(isset(
$_POST["submitbutt6"])) $toadd = '£Ì';
                if(isset(
$_POST["submitbutt7"])) $toadd = '£Í';
                if(isset(
$_POST["submitbutt8"])) $toadd = '£Î';
                if(isset(
$_POST["submitbutt9"])) $toadd = '£Ï';
                if(isset(
$_POST["submitbutt10"])) $toadd = '£Ð';
                if(isset(
$_POST["submitbutt11"])) $toadd = '£Ñ';
                if(isset(
$_POST["submitbutt12"])) $toadd = '£Ò';
    
                
$charname = $_POST["charname"];
                
$charname2 = $charname;
    
                if(
$_POST["pos"] == "ahead") $charname2 = $toadd.$charname;
                else if(
$_POST["pos"] == "behinde") $charname2 = $charname.$toadd;
                else 
$charname2 = $charname.$toadd;
    
                
$newcash = $mycash - 5000;
    
                if(
$newcash >= 0)
                {
                    try
                    {
                        
$cashvalue = sprintf("SELECT count(*) FROM %s.t_users WHERE a_portal_index=$userid AND a_zone_num>=0", $CMS_LCAct);
                             
$query = mysql_query($cashvalue);
                        
$count = mysql_result($query,0);
                        if(
$count == 0)
                        {
                            
$cashvalue = sprintf("UPDATE %s.bg_user SET cash=$newcash WHERE user_code=$userid", $CMS_LCAuth);
                                 
$query = mysql_query($cashvalue);
                            
$command = sprintf("UPDATE %s.t_characters SET a_nick='$charname2' WHERE a_nick='$charname'", $CMS_LCDb);
                            
$query = mysql_query($command);
                            
$tpl->newBlock('success');
                            
$tpl->Assign('msg', 'You can now login ingame, thanks.<br>You will redirect in 10 seconds.');
                            
header("refresh:10;url=./index.php"); 
                        }
                        else
                        {
                            
$tpl->newBlock('error');
                            
$tpl->Assign('msg', 'Please logout ingame first.<br>You will redirect in 5 seconds.');
                            
header("refresh:5;url=./online_shop.php"); 
                        }
                    }
                    catch(
Exception $e)
                    {
                        
$tpl->newBlock('error');
                        
$tpl->Assign('msg', 'Unknown error, please try again.<br>You will redirect in 5 seconds.');
                        
header("refresh:5;url=./online_shop.php");
                    }
                }
                else
                {
                    
$tpl->newBlock('error');
                    
$tpl->Assign('msg', 'Not enough cash.<br>You will redirect in 5 seconds.');
                    
header("refresh:5;url=./donate.php");
                }
            }
            else if(
$mode == "buysne")
            {
                
$toadd = '';
    
                if(isset(
$_POST["submitbutt1"])) $toadd = '£Á';
                if(isset(
$_POST["submitbutt2"])) $toadd = '£Â';
                if(isset(
$_POST["submitbutt3"])) $toadd = '£Ó';
                if(isset(
$_POST["submitbutt4"])) $toadd = '£Õ';
                if(isset(
$_POST["submitbutt5"])) $toadd = '£Õ';
                if(isset(
$_POST["submitbutt6"])) $toadd = '£×';
                if(isset(
$_POST["submitbutt7"])) $toadd = '£Ø';
    
                
$charname = $_POST["charname"];
                
$charname2 = $charname;

                if(
$_POST["pos"] == "ahead") $charname2 = $toadd.$charname;
                else if(
$_POST["pos"] == "behinde") $charname2 = $charname.$toadd;
                else 
$charname2 = $charname.$toadd;
    
                
$newcash = $mycash - 10000;
    
                if(
$newcash >= 0)
                {
                    try
                    {
                        
$cashvalue = sprintf("SELECT count(*) FROM %s.t_users WHERE a_portal_index=$userid AND a_zone_num>=0", $CMS_LCAct);
                             
$query = mysql_query($cashvalue);
                        
$count = mysql_result($query,0);
                        if(
$count == 0)
                        {
                            
$cashvalue = sprintf("UPDATE %s.bg_user SET cash=$newcash WHERE user_code=$userid", $CMS_LCAuth);
                                 
$query = mysql_query($cashvalue);
                            
$command = sprintf("UPDATE %s.t_characters SET a_nick='$charname2' WHERE a_nick='$charname'", $CMS_LCDb);
                            
$query = mysql_query($command);
                            
$tpl->newBlock('success');
                            
$tpl->Assign('msg', 'You can now login ingame, thanks.<br>You will redirect in 10 seconds.');
                            
header("refresh:10;url=./index.php"); 
                        }
                        else
                        {
                            
$tpl->newBlock('error');
                            
$tpl->Assign('msg', 'Please logout ingame first.<br>You will redirect in 5 seconds.');
                            
header("refresh:5;url=./online_shop.php"); 
                        }
                    }
                    catch(
Exception $e)
                    {
                        
$tpl->newBlock('error');
                        
$tpl->Assign('msg', 'Unknown error, please try again.<br>You will redirect in 5 seconds.');
                        
header("refresh:5;url=./online_shop.php");
                    }
                }
                else
                {
                    
$tpl->newBlock('error');
                    
$tpl->Assign('msg', 'Not enough cash.<br>You will redirect in 5 seconds.');
                    
header("refresh:5;url=./donate.php");
                }

            }
            else
            {
                
$tpl->newBlock('my_shop');
            }
        }
        else
        {
            
$tpl->newBlock('error');
            
$tpl->Assign('msg', 'Cant select database!');
        }
    } 
    else 
    {
        
$tpl->newBlock('error');
        
$tpl->Assign('msg', 'Please Login!');
    }

    
$tpl->printToScreen();
    
credit($_SESSION['LicencedVervion'],$_SESSION['LicencedOwner']);
    include 
'styles/'.$style.'/tpl/extras/footer.php';
?>
config.php
PHP Code:
<?php

    
//GM Guild Name (hides from ranks)
    
$gm_guild = "GameMaster";

    
    
// Footer Registered To Info
    
$_SESSION['LicencedOwner'] = "LastChaos";
    
$_SESSION['LicencedHost'] = "#";
    

    
// Mysql IP
    
$dbhash["cms_lc_host"] = 'localhost'; // dns or ip
    
    
    // Mysql Login    
    
$dbhash["cms_lc_username"] = 'root'; // Mysql username
    
$dbhash["cms_lc_password"] = ''; // Mysql password
    
    
    // Mysql Databases
    
$dbhash["cms_lc_auth"] = "auth"; // auth database
    
$dbhash["cms_lc_db"] = "db"; // db database
    
$dbhash["cms_lc_data"] = "data"; // data database
    
$dbhash["cms_lc_site"] = "seite"; // Website Database Name
    
$dbhash["cms_lc_authORdb"] = "auth"; // t_users


    // Status page settings
    
$ptime = "3";  // Timeout limit
    
$Lip = "213.136.89.159";  // Login IP
    
$Lport = "4001";  // Login Port 
    
$Bip = "127.0.0.1";  // Billing IP
    
$Bport = "8888";  // Billing Port
    
$G1ip = "213.136.89.159";  // GS1 IP
    
$G1port = "4101";  //GS1 Port
    
$G2ip = "213.136.89.159";  // GS2 IP
    
$G2port = "4201";  //GS2 Port
    
$G3ip = "213.136.89.159";  // GS3 IP
    
$G3port = "4301";  //GS3 Port
    
$G4ip = "213.136.89.159";  // GS4 IP
    
$G4port = "4401";  //GS4 Port
    
$G5ip = "213.136.89.159";  // GS5 IP
    
$G5port = "4501";  //GS5 Port
    
$G6ip = "213.136.89.159";  // GS6 IP
    
$G6port = "4601";  //GS6 Port



    // FOR EVENTS ADDS % CASH
    // Say you run a cash event so when someone donates you give them 30% more cash you put 30 in below
    
$BonusCash = "0";

    
    
/* SMTP Server PHP Support
    set to yes if your php supports smtp. Set to no if you get smtp error when registering. */
    
$Allow_Email_sending = 'no'; //  no or yes
    
    
    
    // IMPORTANT : 
    // Never share this salt with anyone!
    //(you should change this to match your server if running ep2!!)
    
$config["Salt"] = 'phoohie1yaihooyaequae7PuiWoeNgahjieth3ru3yeeghaepahb7aeYaipe2we6zii6mai6uweig8siasheinoungeoyeiLohShi2xoh2xi8ooxee9ahpiehahc9Phe';

    
    
// Your Time Zone
    // List of Supported Timezones
    // http://php.net/manual/en/timezones.php
    
date_default_timezone_set('Europe/Berlin');

    
// RegisterGroup
    // Set the Group which is user become by registration
    // Change if you want start with other group
    
$registergroup = '2';

?>
kann mir wer helfen warum ich ein error angezeigt bekomme
Y77as is offline  
Old   #2

 
elite*gold: 2
Join Date: May 2010
Posts: 2,254
Received Thanks: 1,919
Quote:
Originally Posted by Y77as View Post
PHP Code:
<?php
// Mysql Databases
    
[B]$dbhash["cms_lc_auth"] = "auth";[/B] // auth database
    
$dbhash["cms_lc_db"] = "db"; // db database
    
$dbhash["cms_lc_data"] = "data"; // data database
    
$dbhash["cms_lc_site"] = "seite"; // Website Database Name
    
[B]$dbhash["cms_lc_authORdb"] = "auth";[/B] // t_users
?>
Prüf bitte ob in der Database[$dbhash["cms_lc_auth"]] die bg_user und in der Database[$dbhash["cms_lc_authORdb"]] die t_users vorhanden ist. Bzw. mach mal ein Screenshot von deinen Databases(in wahrscheinlich Navicat)
Ih¢sãs123 is offline  
Old   #3
 
elite*gold: 0
Join Date: Dec 2019
Posts: 3
Received Thanks: 0
habe das selbe problem bekomme fehler HTTP error 500
LcEP2 is offline  
Old   #4

 
EEOI's Avatar
 
elite*gold: 50
Join Date: Feb 2010
Posts: 3,038
Received Thanks: 2,519
Quote:
Originally Posted by LcEP2 View Post
habe das selbe problem bekomme fehler HTTP error 500
500 ist ein Webserver Problem, nicht eins der Datenbank.
EEOI is offline  
Old   #5
 
elite*gold: 0
Join Date: Dec 2019
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by EEOI View Post
500 ist ein Webserver Problem, nicht eins der Datenbank.
Danke dir für die INFO!
sprich evtl. eine ältere php version
LcEP2 is offline  
Reply

« Hey | Eternia ?!? »

Similar Threads Similar Threads
[ENG] Error: Error 1 error C2601: 'HackMain' local function definitions are illegal
08/20/2013 - C/C++ - 1 Replies
So, as the title says I've been encountering an error Error 1 error C2601: 'HackMain' local function definitions are illegal I'm running on VC++ (Visual C++) This is my code: void HackMain() { for (;; ) { HackThread(); }
İbot Error-Error Video- Error İmages-HELP
04/10/2012 - DarkOrbit - 11 Replies
SORRY, MY ENGLİSH VERY BAD.I USE TO GOOGLE TRANSLATE :) Most people trying to ibot but in my computer İbot not working. Declared out this error everywhere but I do not get answers Here's the error Video http://youtu.be/q0fK09v-K3c
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_
04/08/2012 - elite*gold Trading - 2 Replies
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_uri URL is not properly formatted Das bekomme ich wenn ich ne App installiere... ich habe schon 3 Apps richtig installiert, danach kam immer das bei anderen Apps die ich installiert habe.. was heisst das? redirect_uri URL is not properly formatted



All times are GMT +2. The time now is 03:01.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.