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

[PHP]Account, character and clan self-management usefull includes.

Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
Okay so, here is some old files (it's coming from my second website) so it's possible that code is unreadable because i was young when i maded it.



Password: oldstuff

How adding it to a themplate:
PHP:
<?PHP 
 if(file_exists('./inc/inc_'. $_GET['a'] .'.php')) {include('./inc/inc_'. $_GET['a'] .'.php'); } 
 elseif($_GET['a'] == '') {include('./inc/inc_login.php');}
 else{echo 'This page does not exist !';}
 ?>
You only need to put this at the content part and for each time you gonna use ?a=x, x gonna be the content in ./inc/inc_x.php so you guess that if i change x for login or any other page in inc folder it's gonna change the cotent for this page.

Exemple:
If i execute url mysite.com/?a=login, content will be the login.


What it contain ?
-Login
-Password change
-Contry change
-Age change
-Character name change
-Hair change
-Face change
-Complet clan management
-Emblem upload
And alot of little stuff like that.

Owh and you'll need to change ODBC connection option in odbc.php and edit $CEURL in inc_clan.php. Don't forget to start a session.
Dot.
 
Last edited:
Ecchi addicted
Joined
Nov 30, 2008
Messages
464
Reaction score
92
Nice, this is useful thanks.
 
Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
I have logged the error ..

[Wrong security code !]
session_start(); or just put it automatic on php.ini "session.auto_start = 1" and don't forget to create a folder for your sessions by changig this 'session.save_path = "C:/SESSIONS/"' and create a folder named SESSIONS in C:\.
 
Last edited:
Banned
Banned
Joined
Aug 9, 2009
Messages
425
Reaction score
74
I got this working although Im only interested in clan management aswell ^^

Under
Code:
<?php
add
Code:
session_start();

In these files.

inc/inc_auth.php
inc/inc_clan.php
inc/inc_client.php
inc/inc_logout.php
 
Last edited:
Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
I got this working although Im only interested in clan management aswell ^^

Under
Code:
<?php
add
Code:
session_start();
In these files.

inc/inc_auth.php
inc/inc_clan.php
inc/inc_client.php
inc/inc_logout.php
PHP:
<?PHP 
 session_start();
 if(file_exists('./inc/inc_'. $_GET['a'] .'.php')) {include('./inc/inc_'. $_GET['a'] .'.php'); } 
 elseif($_GET['a'] == '') {include('./inc/inc_login.php');}
 else{echo 'This page does not exist !';}
 ?>
 
Last edited:
Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
No, anti sql injection..

PHP:
//The well-known antisql injection. Bad enough, it's needed.
function antisql($sql) {
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|--|\\\\)/"),"",$sql);
$sql = str_replace("'", "''", $sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}
 
Last edited:
Legendary Battlemage
Joined
Dec 26, 2008
Messages
609
Reaction score
14
hmm.. I cannot login for some reason... I have put the correct info and the code and still won't login :S.
 
Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
sessions probably.. or odbc connection error..
 
Last edited:
Banned
Banned
Joined
Aug 9, 2009
Messages
425
Reaction score
74
PHP:
<?PHP 
 session_start();
 if(file_exists('./inc/inc_'. $_GET['a'] .'.php')) {include('./inc/inc_'. $_GET['a'] .'.php'); } 
 elseif($_GET['a'] == '') {include('./inc/inc_login.php');}
 else{echo 'This page does not exist !';}
 ?>
sense you added session_start();
inside inc_auth.php you will get conflicting errors.
But the above script isn't useful if your adding it a website
cause most sites already have the login. What ive done is strip
it down and changed the session and just included it into my
current control panel and added session_start();
 
Back
Top