Re: [PHP]Account, character and clan self-management usefull includes.
thank you! btw is this sql injectable?
Re: [PHP]Account, character and clan self-management usefull includes.
No, anti sql injection..
PHP Code:
//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;
}
Re: [PHP]Account, character and clan self-management usefull includes.
hmm.. I cannot login for some reason... I have put the correct info and the code and still won't login :S.
Re: [PHP]Account, character and clan self-management usefull includes.
sessions probably.. or odbc connection error..
Re: [PHP]Account, character and clan self-management usefull includes.
Quote:
Originally Posted by
belette321
PHP Code:
<?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();
Re: [PHP]Account, character and clan self-management usefull includes.
Re: [PHP]Account, character and clan self-management usefull includes.
Quote:
Originally Posted by
Dude3889
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();
If you put it in my file you no more need to put the session_start(); inside inc_auth.php, inc_client.php, inc_clan.php or inc_logout... because it will initialize session for each page.
Re: [PHP]Account, character and clan self-management usefull includes.
The coding is pretty messy and some small things I wouldn't of done, but I'm only moderately knowledged in PHP so idk. Good release though not much is released around here lately.
Re: [PHP]Account, character and clan self-management usefull includes.
Quote:
Originally Posted by
belette321
No, anti sql injection..
PHP Code:
//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;
}
Remember the function sql_regcase for php 5.3. is deprecated.
Thanks for the release