• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Chumpy's simple regpage and cash shop v1.5 beta

Newbie Spellweaver
Joined
Feb 27, 2011
Messages
63
Reaction score
21
Code:
<?php
session_start();

define('IN_CP',true);
define('PAGE_INDEX',$_SERVER['PHP_SELF']);

if (ini_get('register_globals')!=0) {
  echo 'The "register_globals" setting in your php.ini is on. This is a security problem and must be fixed.';
  die;
}

$uid='';$pwd='';$v1=''; $v2='';
if (isset($_REQUEST['uid'])) $uid=$_REQUEST['uid'];
if (isset($_REQUEST['pwd'])) $pwd=($_REQUEST['pwd']);
if (isset($_REQUEST['v1'])) $v1=$_REQUEST['v1'];
if (isset($_REQUEST['v2'])) $v2=$_REQUEST['v2'];
if (isset($_REQUEST['logout'])) {
	session_destroy();
	header('Refresh: 1; URL='.PAGE_INDEX);
	html_header('Logging out...');
                echo 'Logging out...';
	exit;
}

include('config.php');
$link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
if (!$link) die('Could not connect to MSSQL database.');

if ($uid<>'' && $pwd<>'') {
  $r=mssql_query('select ID,UserNum,AuthKey from '.DB_ACC.'.dbo.cabal_auth_table where id="'.$uid.'" and PWDCOMPARE("'.$pwd.'", Password') = 1
  if (mssql_num_rows($r)==0) {
    header('Refresh: 4; URL='.PAGE_INDEX);
    html_header('Login failed...');
    echo 'Login Failed...';
    exit;
  } else {
    $row = mssql_fetch_row($r);
    $_SESSION['player']=$row[0];
    $_SESSION['v1']=$row[1];
    $_SESSION['v2']=$row[2];
    header('Refresh: 1; URL='.PAGE_INDEX);
    html_header('Logging in...');
    echo 'Logging in...';
    exit;
  }	
}

if ($v1<>'' && $v2<>'') {
  $r=mssql_query('select ID from '.DB_ACC.'.dbo.cabal_auth_table where UserNum="'.$v1.'" and AuthKey="'.$v2.'"');	
  if (mssql_num_rows($r)==0) {
    header('Refresh: 4; URL='.PAGE_INDEX);
    html_header('Login failed...');
    echo 'Login Failed...';
    exit;
  } else {
    $row = mssql_fetch_row($r);
    $_SESSION['player']=$row[0];
    $_SESSION['v1']=$v1;
    $_SESSION['v2']=$v2;
  }	
}

if (isset($_REQUEST['action'])) {
	$action=$_REQUEST['action'];
} else {
	$action='';
}

html_header();

echo '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td align="center">';

// Menu bar

echo '<table width="600" cellspacing="0" cellpadding="0" border="0">';
echo '<tr><td align="left"><img src="./images/logo.png" style="position:absolute;top:0px" height="100" width="600" /></td><tr>';
echo '<tr><td align="center">';
  if (!isset($_SESSION['v1'])) {
    echo '<form method="post" action="'.PAGE_INDEX.'?login">';
    echo 'Login: <input type="text" name="uid" class="editbox" size="10" /> ';
    echo 'Pass: <input type="password" name="pwd" class="editbox" size="10" /> ';
    echo '<input type="submit" name="login" value="Log in" class="button" />';
    echo '</form>';
  } else {
    $action='account';
  }
echo '</td></tr></table>';
  
if ($action<>'') {
  switch($action) {
    case 'account':
      include('account.php');
      break;  
    case 'deposit':
      include('account.php');
      break;
    default:
      include('reg.php');	  
  }	
} else {
  include('reg.php');	
}

echo '</td></tr></table>';
echo '</body></html>';

///////////////////////////////////////////////////////////////////////////////

function box_top($alz,$is_gm=true) {
  echo '<table width="800" border="0" cellspacing="0" cellpadding="0">';
  echo '<tr>';
  echo '<td height="25" background="images/Item_Game_Box_01b.gif" style="PADDING-RIGHT: 0px; PADDING-LEFT: 773px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"><img src="images/Item_Game_Box_10.gif" width="11" height="10" border="0" onclick="javscript:location.href=\''.PAGE_INDEX.'?logout\'" style="cursor:pointer;" alt="Item Shop Close"></td>';
  echo '</tr>';
  echo '<tr>';
  echo '<td><img src="images/Item_Game_Box_02.gif" width="800" height="15"></td>';
  echo '</tr>';
  echo '<tr>';
  echo '<td align="center" background="images/Item_Game_Box_03.gif">';
    echo '<table width="772" border="0" cellspacing="0" cellpadding="0">';
    echo '<tr>';
    echo '<td width="178" align="center" valign="top">';
      echo '<table width="174" height="400" border="0" cellpadding="0" cellspacing="0">';
      echo '<tr>';
      echo '<td width="174" height="50" align="center" class="white">Welcome <strong>'.$_SESSION['player'].'</strong></td>';
      echo '</tr>';
      echo '<tr>';
        echo '<td width="174" height="55" background="images/Item_Game_Box_05.gif" class="teal" style="PADDING-RIGHT: 0px; PADDING-LEFT: 15px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">';

        echo '<table border="0" cellspacing="0" cellpadding="0">';
        echo '<tr>';
        echo '<td> </td>';
        echo '<td class="cloud2"><strong>Bank Alz</strong></td>';
        echo '</tr>';
        echo '<tr>';
        echo '<td width="20"><strong class="white"><img src="images/Item_premium_R_03.gif" width="16"  vspace="0"></strong></td>';
        echo '<td width="130"><strong class="orange">'.$alz.'</strong></td>';
        echo '</tr>';
        echo '</table>';

        echo '</td>';
      echo '</tr>';
      echo '<tr>';
      echo '<td align="center" valign="top" background="images/Item_Game_Box_06.gif">';
        echo '<img src="images/Item_Game_Box_20.gif" width="160" height="26" border="1" style="CURSOR:pointer" onclick="javascript:location.href=\'./webshop.php?v1='.$_SESSION['v1'].'&v2='.$_SESSION['v2'].'\'" width="160" height="26" vspace="3" border="0"></br>';
        echo '<img src="images/Item_Game_Box_21.gif" width="160" height="26" border="1" style="CURSOR:pointer" onclick="javascript:location.href=\'./index.php?action=account\'" width="160" height="26" vspace="3" border="0"></br>';
        if ($is_gm==true) echo '<img src="images/Item_Game_Box_22.gif" style="CURSOR:pointer" onclick="javascript:location.href=\'./admin.php?v1='.$_SESSION['v1'].'&v2='.$_SESSION['v2'].'\'" width="160" height="26" vspace="3" border="0"></br>';
        echo '<img src="images/Item_Game_Box_23.gif" width="160" height="26" border="1" style="CURSOR:pointer" onclick="javascript:location.href=\''.LINK_FORUM.'\'" width="160" height="26" vspace="3" border="0"></td>';
      echo '</tr>';   
      echo '<tr>';
      echo '<td height="5"><img src="images/Item_Game_Box_07.gif" width="174" height="5"></td>';
      echo '</tr>';
      echo '<tr>';
      echo '<td height="5"></td>';
      echo '</tr>';
      echo '</table>';
    echo '</td>';		
    echo '<td align="center" valign="top"  style="padding: 5 5 5 0">';
    	
  echo '<table width="594"  border="0" cellspacing="0" cellpadding="0">';
  echo '<tr><td valign="top"><img src="images/Item_Box_Img_01.gif" width="594" height="12"></td></tr>';
  echo '<tr><td valign="top" align="center" background="images/Item_Box_Img_03.gif" height="500" style="padding-top:8px">';
    echo '<table width="571" border="0" cellspacing="0" cellpadding="0">';
    echo '<tr>';
    echo '<td width="569" align="center" valign="top">';

	
}

function box_bottom() {
    echo '</td>';
    echo '</tr>';
    echo '</table>';
  echo '</td></tr>';
  echo '<tr><td valign="top"><img src="images/Item_Box_Img_02.gif" width="594" height="12"></td></tr>';
  echo '</table>';
    echo '</td>';
    echo '</tr>';
    echo '</table>';
  echo '</td>';
  echo '</tr>';
  echo '<tr>';
  echo '<td><img src="images/Item_Game_Box_04.gif" width="800" height="17"></td>';
  echo '</tr>';
  echo '</table>';		
}

function html_header($title=PAGE_TITLE) {
	echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >';
                echo '<HTML><HEAD>';
                echo '<meta content="JavaScript" name="vs_defaultClientScript">';
                echo '<link title="style" href="layout.css" type="text/css" rel="stylesheet">';	
                echo '<meta http-equiv="Content-Type" content="text/html; charset=US">';
                echo '<title>'.$title.'</title></head>';
                echo '<body>';	
	
}
?>

It will work, once i get the code fixed.
 
Newbie Spellweaver
Joined
Feb 27, 2011
Messages
63
Reaction score
21
nvm fixed it. it wasn't returning rows, becuase DB wasnt defined properly.. thanks.
 
Newbie Spellweaver
Joined
Feb 27, 2011
Messages
63
Reaction score
21
huh? Fish? Who's got bait?

sir if you are not getting items..config your server "IDX" in config.php.. post back..
 
█║▌║▌║TheMerc iful║▌║▌║█
Loyal Member
Joined
Jan 29, 2005
Messages
1,367
Reaction score
80
huh? Fish? Who's got bait?

sir if you are not getting items..config your server "IDX" in config.php.. post back..

LOL! What He Mean Was To Teach You How To Do It Your Self... :junglejane:

Which Part Now You Guys In Updating This Web To EP8 Modifications?!...
 
Newbie Spellweaver
Joined
Aug 23, 2012
Messages
24
Reaction score
2
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 37.138.39.155 in C:\AppServ\www\index.php on line 26
Could not connect to MSSQL database. !?
 
Junior Spellweaver
Joined
Mar 16, 2010
Messages
163
Reaction score
3
how to fix this..

Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\index.php on line 26


my setting on config.default.php is this

<?php

// General options for both reg page and cash shop

// Title shown at the top of pages
define('PAGE_TITLE','My Cabal Server');

// Link to website or patch
define('LINK_WSITE','http://www.mywebs.com');

// Text to display for link
define('NAME_WSITE','My Website Name');

// Link to forums
define('LINK_FORUM','http://mywebs.com/forums');

// Text to display for link
define('NAME_FORUM','My Forum Name');


// MSSQL server connection details
// Database server
define('DB_ADDR','192.168.56.1');
// Database login
define('DB_USER','sa');
// Database password
define('DB_PASS','jeromelim1109');

// In case you have a different db names
define('DB_ACC','ACCOUNT');
define('DB_GAM','GAMEDB');
define('DB_CCA','CABALCASH');
define('DB_CSH','CASHSHOP');

// ServerIdx MUST match the one in WorldSvr_XX_YY.ini or cash items
// Will not get delivered correctly.
define('SVR_IDX','24');

// Category names for cash shop admin panel
$cats=array(1=>'Costumes',2=>'Gear',3=>'Pets',4=>'Consumables',5=>'Items');

// Print debug info at the top of the cash shop pages
define('TESTMODE',true);

// Maintenance mode, open to GMs only.
define('MAINTMODE',false);

// Uses LastIp validation as well as UserNum and AuthKey
// Can cause problems
define('IPVALIDATION',true);

// Allow transfer of Alz from warehoue to the bank
// Set to false if you don't want to use Alz for cash items
define('ALLOW_BANK',true);

?>


i Use xampp 1.7.1 tnx..
 
Newbie Spellweaver
Joined
Jun 4, 2012
Messages
17
Reaction score
0
I've installed this cashshop and can't login.

Registration works and I can login ingame. But it won't work at this Cashshop, any solutions or suggestions?
 
Newbie Spellweaver
Joined
Jun 18, 2013
Messages
27
Reaction score
11
Hello guys, Someone can help to find web address in a 374 cabalmain version? .. just cant find it (I used ollyDBG and PE explorer).. nothing . Ty and very apreciate your answer!


Solved: i was searching in a wrong place! :S
 
Last edited:
Skilled Illusionist
Joined
Jul 12, 2011
Messages
389
Reaction score
34
Is it possible that only listed accounts can access the webshop admin?
 
Back
Top