<?php
define('MSSQL_HOST', 'IP');
define('MSSQL_USER', 'USER');
define('MSSQL_PASS', 'PASS');
$mssql = odbc_connect('Driver={SQL Server};Server='.MSSQL_HOST.';', MSSQL_USER, MSSQL_PASS);
require_once('ayah.php');
$ayah = new AYAH();
function mssql_escape_string($str){
$str = htmlentities($str);
if (ctype_alnum($str))
return $str;
else
return str_ireplace(array(';', '%', "'"), "", $str);
}
foreach ($_GET as $key=>$getvar){ $_GET[$key] = mssql_escape_string($getvar); }
foreach ($_POST as $key=>$postvar){ $_POST[$key] = mssql_escape_string($postvar); }
if (!isset($_POST['reg_username']))
$_POST['reg_username'] = '';
odbc_exec($mssql, 'USE [ACCOUNT]');
$checkacc = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [cabal_auth_table] WHERE ID=\'' . mssql_escape_string($_POST['reg_username']) . '\'');
$errors = array();
if (empty($_POST['reg_username']) || empty($_POST['reg_password']))
$errors[] = 'You must fill out all fields.';
if (!empty($_POST['reg_username']) && odbc_result($checkacc, 'count') > 0)
$errors[] = '' . $_POST['reg_username'] . ' is already in use.';
if (!empty($_POST['reg_username']) && (strlen($_POST['reg_username']) > 16 || strlen($_POST['reg_username']) < 6))
$errors[] = 'Usernames must be between 6 - 16 characters.';
if (!empty($_POST['reg_password']) && (strlen($_POST['reg_password']) > 16 || strlen($_POST['reg_password']) < 6))
$errors[] = 'Passwords must be between 6 - 16 characters.';
if (array_key_exists('reg_submit', $_POST)) {
$score = $ayah->scoreResult();
if ($score) {
if (count($errors) > 0) {
echo '<div class="fail">';
foreach ($errors as $error) {
echo $error . '<br/>';
}
echo '</div>';
} else {
odbc_exec($mssql, 'EXEC [dbo].[cabal_tool_registerAccount]"'.mssql_escape_string($_POST['reg_username']).'","'.mssql_escape_string($_POST['reg_password']).'"');
echo '<div class="success">Your account has been successfully created.</div>';
}
} else {
echo '<div class="fail">Invalid Captcha.</div>';
}
}
?>
<!DOCTYPE html>
<head>
<title>Cabal EP8 Registration</title>
<meta charset="utf-8" />
</head>
<body>
<form method="post" action="register.php">
<table>
<tr>
<td>Username:</td>
<td><input type="text" name="reg_username" autocomplete="off" maxlength="16"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="reg_password" autocomplete="off" maxlength="16"></td>
</tr>
<tr>
<td><?php echo $ayah->getPublisherHTML(); ?></td>
<td><input type="submit" name="reg_submit" value="Create Account"></td>
</tr>
</table>
</form>
</body>
</html>
Here's a reg page for cabal based on ODBC, enjoy
Requirements:
You must be registered to see links You must be registered to see links You must be registered to see linksCode:<?php define('MSSQL_HOST', 'IP'); define('MSSQL_USER', 'USER'); define('MSSQL_PASS', 'PASS'); $mssql = odbc_connect('Driver={SQL Server};Server='.MSSQL_HOST.';', MSSQL_USER, MSSQL_PASS); require_once('ayah.php'); $ayah = new AYAH(); function mssql_escape_string($str){ $str = htmlentities($str); if (ctype_alnum($str)) return $str; else return str_ireplace(array(';', '%', "'"), "", $str); } foreach ($_GET as $key=>$getvar){ $_GET[$key] = mssql_escape_string($getvar); } foreach ($_POST as $key=>$postvar){ $_POST[$key] = mssql_escape_string($postvar); } if (!isset($_POST['reg_username'])) $_POST['reg_username'] = ''; odbc_exec($mssql, 'USE [ACCOUNT]'); $checkacc = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [cabal_auth_table] WHERE ID=\'' . mssql_escape_string($_POST['reg_username']) . '\''); $errors = array(); if (empty($_POST['reg_username']) || empty($_POST['reg_password'])) $errors[] = 'You must fill out all fields.'; if (!empty($_POST['reg_username']) && odbc_result($checkacc, 'count') > 0) $errors[] = '' . $_POST['reg_username'] . ' is already in use.'; if (!empty($_POST['reg_username']) && (strlen($_POST['reg_username']) > 16 || strlen($_POST['reg_username']) < 6)) $errors[] = 'Usernames must be between 6 - 16 characters.'; if (!empty($_POST['reg_password']) && (strlen($_POST['reg_password']) > 16 || strlen($_POST['reg_password']) < 6)) $errors[] = 'Passwords must be between 6 - 16 characters.'; if (array_key_exists('reg_submit', $_POST)) { $score = $ayah->scoreResult(); if ($score) { if (count($errors) > 0) { echo '<div class="fail">'; foreach ($errors as $error) { echo $error . '<br/>'; } echo '</div>'; } else { odbc_exec($mssql, 'EXEC [dbo].[cabal_tool_registerAccount]"'.mssql_escape_string($_POST['reg_username']).'","'.mssql_escape_string($_POST['reg_password']).'"'); echo '<div class="success">Your account has been successfully created.</div>'; } } else { echo '<div class="fail">Invalid Captcha.</div>'; } } ?> <!DOCTYPE html> <head> <title>Cabal EP8 Registration</title> <meta charset="utf-8" /> </head> <body> <form method="post" action="https://forum.ragezone.com/register.php"> <table> <tr> <td>Username:</td> <td><input type="text" name="reg_username" autocomplete="off" maxlength="16"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="reg_password" autocomplete="off" maxlength="16"></td> </tr> <tr> <td><?php echo $ayah->getPublisherHTML(); ?></td> <td><input type="submit" name="reg_submit" value="Create Account"></td> </tr> </table> </form> </body> </html>
many complete web released already on cabal section.. i dont see a point of on this.. since im working with sqlsrv i dont see a point of using others...
odbc connect mainly work only on windows.. sqlsrv working on windows and linux too..
many complete web released already on cabal section.. i dont see a point of on this.. since im working with sqlsrv i dont see a point of using others...
odbc connect mainly work only on windows.. sqlsrv working on windows and linux too..
Good job, every kind of release is welcome here dont listen DexterI gonna use it on my website i hope u will not be angry
The SQLSRV extension can be used on the following operating systems:
- Windows Vista Service Pack 2 or later
- Windows Server 2008 Service Pack 2 or later
- Windows Server 2008 R2
- Windows 7
On my project im using adodb and smarty + fully mvc based site.. and sqlsrv can be use with some linux package.. and lot of server using my old website.. which was good for beginning... but now i feel my code so uglyanyway odbc solution is useless on my mind.. but gl to use it..
On my project im using adodb and smarty + fully mvc based site.. and sqlsrv can be use with some linux package.. and lot of server using my old website.. which was good for beginning... but now i feel my code so uglyanyway odbc solution is useless on my mind.. but gl to use it..
fully mvc? the fallen script was not even close to MVC architecture
MVC = Model - View - Controller
Ur script is focused on one file, where u have all code.
for futhure do not mix html/css with php code for that u have mvc to load templates from other file.
edit://
but yea respect for releaseno offense.
on my CURRENT project... fallen is based old structured language and using mssql_query-s..
i think so i will be done on middle of summer..
U want to release it? Maybe make thread in develop section so we can improve ur script, who knows
I have already also done the engine, fully MVC system + Rain Template (this is real MVC ^^) currently have finished basic things, login, register, and the frontpage (news system, svr status, channel status, tg times, arcane times, saint holders, bringer holders, submenus downloads fully auto from db, etc etc). But the problem is i am out of ideas for design :F