/include/functions.php
PHP | 789 lines | 754 code | 27 blank | 8 comment | 16 complexity | ac48bd8b84b264d74f88c08180772a80 MD5 | raw file
- <?php
-
- $dBASEURL = "http://fcabal.net/";
- $server = 'localhost';
- $uid = 'sa';
- $pwd = '123456';
- //SQL Info
- define('DB_ADDR',$server);
- define('DB_USER',$uid);
- define('DB_PASS',$pwd);
- //DB's
- define('DB_ACC','Account');
- define('DB_GS','Server01');
- define('DB_CS','CashShop');
- define('DB_CC','CabalCash');
- define('DB_NC','NetCafeBilling');
-
- function stdhead(){
- GLOBAL $dBASEURL;
- echo'
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="' . $dBASEURL . 'style.css"/>
- <link rel="stylesheet" type="text/css" href="' . $dBASEURL . 'font-awesome.css"/>
- <script type="text/javascript" src="'.$dBASEURL.'js/jquery-1.9.1.min.js">
- </script>
- <script type="text/javascript" src="'.$dBASEURL.'js/jquery.bxslider.min.js">
- </script>
- <script type="text/javascript" src="'.$dBASEURL.'js/script.js">
- </script>
- <link rel="stylesheet" type="text/css" href="'.$dBASEURL.'/jquery.bxslider.css" />
- <script type="text/javascript">
- $(document).ready(function(e) {
- $(".bxslider").bxSlider({
- auto: true,
- pager: false
- });
- });
- </script>
- <title>
- Funny - Cabal
- </title>
- <!-- Google Analytics -->
- <script>
- (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\');
- ga(\'create\', \'UA-41777318-1\', \'fcabal.net\');
- ga(\'send\', \'pageview\');
- </script>
- <!-- End Google Analytics -->
- </head>
- <body>
- <div id="wrap">
- <div id="header">
- ';
- if($_COOKIE['logined'] != 1){
- echo'
- <!--/social-->
- <div id="formss">
- <form class="form-1" action="takelogin.php" method="post">
- <p class="field">
- <input type="text" name="login" placeholder="Username">
- <i class="icon-user icon-large">
- </i>
- </p>
- <p class="field">
- <input type="password" name="password" placeholder="Password">
- <i class="icon-lock icon-large">
- </i>
- </p>
- <p class="submit">
- <button type="submit" name="submit">
- <i class="icon-arrow-right icon-large">
- </i>
- </button>
- </p>
- </form>
- ';}
- else{
- echo'
- <div id="formss">
- <div id="loginedform">
- <div id="loginedbox">
- Welcome <b class="username">' . $_COOKIE['ID'] . '</b> - <a href="logout.php">Log Out! </a></br>
- <img src=images/pc.png alt="Coins" /> ' . getUserCoins($_COOKIE['usernum']) . ' | <img src="images/tpont.png" alt="T-Point"/> ' . getUserTPoint($_COOKIE['usernum']) . ' | <img src=images/PlayTime.png alt="PlayTime" /> '.getUserPlayTime($_COOKIE['usernum']).' </br>
- Total eCoin: ' . getUserECoin($_COOKIE['usernum']) . ' <br />
- Rankings: <a href="#page_honour-rank">Honour</a> | <a href="#page_playtime-rank">Playtime</a> | <a href="#page_guild-rank">Guild</a>
- </div>
- </div>
- ';
- }
- echo'
- </div>
- <!--/formss-->';
- if($_COOKIE['logined'] != 1){
- echo '<div id="nav">
- <ul>
- <li>
- <a href="#page_home">Home</a>
- </li>
- <li>
- <a href="#page_register" >Register</a>
- </li>
- <li>
- <a href="#page_downloads" >Downloads</a>
- </li>
- <li>
- <a href="#page_informations">Informations</a>
- </li>
- <li>
- <a href="#page_vote">Vote</a>
- </li>
- <li><img id="loading" src="'.$dBASEURL.'/images/ajax-loader.gif" width="56px" height="21" alt="loading" /></li>
- </ul>
- <div id="online">
- '.OnlinePlayerNum().'
- </div>
- <div id="search">
- <form action="takesearch.php" >
- <input type="text" id="s" class="s" name="s"/>
- <input type="submit" id="submit" value="sub"/>
- </form>
- </div>
- <!--/search-->
- </div>
- <!--/nav-->
- ';
- } else {
- echo '<div id="nav">
- <ul>
- <li>
- <a href="#page_home">Home</a>
- </li>
- <li>
- <a href="#page_teamspeak" >TS3srv</a>
- </li>
- <li>
- <a href="#page_downloads" >Downloads</a>
- </li>
- <li>
- <a href="#page_informations">Informations</a>
- </li>
- <li>
- <a href="#page_vote">Vote</a>
- </li>
- <li><img id="loading" src="'.$dBASEURL.'/images/ajax-loader.gif" width="56px" height="21" alt="loading" /></li>
- </ul>
- <div id="online">
- '.OnlinePlayerNum().'
- </div>
- <div id="search">
- <form action="takesearch.php" >
- <input type="text" id="s" class="s" name="s"/>
- <input type="submit" id="submit" value="sub"/>
- </form>
- </div>
- <!--/search-->
- </div>
- <!--/nav-->
- ';
- }
- echo '
- </div>
- <!--/header-->
- </div>
- <div id="wrap2">
- <div id="content">
- <div id="sidebar">
- ';
- if($_COOKIE['logined'] == "1"){
- echo'
- <div class="widgets">
- <div class="title">
- Account
- </div>
- <div class="content">
- <ul id="account-menu">
- <li>
- <a href="donate.php">Donate</a>
- </li>
- <li>
- <a href="paymentwall.php">Donate with Paymentwall</a>
- </li>
- <li>
- <a href="exchangetpoint.php">Exchange T-Points for Coins</a>
- </li>
- <li>
- <a href="exchangeecoin.php">Exchange eCoins for Coins</a>
- </li>
- </ul>
- </div>
- <!--/content-->
- </div>
- <div class="widgets">
- <div class="title">
- Donate
- </div>
- <div class="content" style="text-align: center;" >
- <a href="donate.php"><img src="'.$dBASEURL.'images/Donate2.png" width="283px" alt="Donate" /></a>
- </div>
- <!--/content-->
- </div>
- ';
- }
- echo'
- <!--/widget-->
- <div class="widgets">
- <div class="title">
- Links
- </div>
- <div class="content">
- <ul>
- <li>
- <a href="http://fcabal.net/cstyle">custom style</a>
- </li>
- <li>
- <a href="http://4r.fcabal.net/4r">forum</a>
- </li>
- <li>
- <a href="http://facebook.com/funnycabal">Fcabal Facebook</a>
- </li>
- </ul>
- </div>
- <!--/content-->
- </div>
- <div class="widgets">
- <div class="content">
- <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2funnycabal&width=290&height=258&show_faces=true&colorscheme=light&stream=false&show_border=false&header=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:290px; height:258px;" allowTransparency="true"></iframe>
- </div>
- <!--/content-->
- </div>
- <!--/widget-->
- </div>
- <!--/sidebar-->
- <div id="main-content" class="left">
- ';
- }
-
- function sechead($name){
- echo'
- <div id="section1" class="sections">
- <div class="main_title">
- '.$name.'
- </div>
- <div class="content">
- ';
- }
- function sechead_2($name){
- echo'
- <div id="section1" class="sections">
- <div class="main_title">
- '.$name.'
- </div>
- <div class="content_2">
- ';
- }
-
- function secfoot(){
- echo'
- </div>
- </div>
- <!--/section1-->
- ';
- }
-
-
- function stdfoot(){
- echo'
- </div>
- <!--/left-->
- </div>
- <!--/content-->
- <div id="footer">
- <div id="copy">
- All rights reserved ©FG 2013 Developed
- </div>
- <div id="pro">
- <a href="index.php"><img src="'.$dBASEURL.'imgs/fgamerz.png" /></a>
- </div>
- </div>
- <!--/footer-->
- </div>
- <div style="height:20px; margin:200px auto auto;"></div>
- <!--/wrap-->
- </body>
-
- </html>
- ';
- }
-
- function errBlock($errorid, $backp){
- stdhead();
- sechead(Error);
- echo errorList($errorid) . '</br>';
- echo 'You will be redirected back!';
- secfoot();
- stdfoot();
- //$backpage = 'index.php#page_'.$backp;
- $backpage = 'index.php#page_'.$backp;
- header( "refresh:5;url=$backpage" );
- die();
- }
-
- function errorList($id){
- $return = "";
- switch ($id) {
- case 1:
- $return = "You dont entered username and password!";
- break;
- case 2:
- $return = "You not entered an username!";
- break;
- case 3:
- $return = "You not entered a password!";
- break;
- case 4:
- $return = "Username and/or Password not match!";
- break;
- case 5:
- $return = "You need log in to use this page!";
- break;
- case 6:
- $return = "Your login has failed to paymentwall!";
- break;
- case 7:
- $return = "You dont selected a vote site!";
- break;
- case 8:
- $return = "Your account is disabled! You can't use this function anymore";
- break;
- case 11:
- $return = "You have already voted on xtremetop100 within 12hr!";
- break;
- case 12:
- $return = "You have already voted on gtop100 within 12hr!";
- break;
- case 20:
- $return = "You need log out from the game to use this function!";
- break;
- case 30:
- $return = "You dont have Cash Account activated! Please Vote for activating!";
- break;
- case 31:
- $return = "You dont have any eCoins!";
- break;
- case 32:
- $return = "You dont have any T-Points!";
- break;
- case 33:
- $return = "You have already voted on xtremetop100 within 12hr from this <b><u>IP Address</u></b>!";
- break;
- case 34:
- $return = "You have already voted on gtop100 within 12hr from this <b><u>IP Address</u></b>!";
- break;
- case 100:
- $return = "Unhandled Error";
- break;
- default:
- $return = "Unhandled Error";
- break;
- }
- return $return;
- }
- function sQuery($q, $db){
- $link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- if (!$link) die('Could not connect to MSSQL database.');
-
- $selectdb = mssql_select_db($db, $link);
- if (!$selectdb) die('Could not connect to Database: ' . $db);
-
- $query = mssql_query($q , $link);
-
- $link = mssql_close;
-
- return $query;
- }
-
- function secure($var){
- $var = htmlspecialchars(stripslashes($var));
- $var = str_ireplace("script", "blocked", $var);
- $var = mysql_escape_string($var);
- return $var;
- }
-
- function getUserCoins($user){
-
- $q = 'SELECT Alz FROM dbo.Bank WHERE UserNum = "'.$user.'"';
- $result = sQuery($q, DB_CS);
- $qAlz = "0";
-
- if (mssql_num_rows($result) == 0) {
-
- $qAlz = "Nothing match";
- }
- else{
-
-
-
- while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
- $qAlz = $row['Alz'];
- }
-
- }
- return $qAlz;
- }
- function getUserTPoint($user){
-
- $q = 'SELECT TPoint FROM dbo.Point WHERE UserNum = "'.$user.'"';
- $result = sQuery($q, DB_NC);
- $qTPoint = "0";
-
- if (mssql_num_rows($result) == 0) {
-
- $qAlz = "Nothing match";
- }
- else{
-
-
-
- while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
- $qTPoint = $row['TPoint'];
- }
-
- }
- return $qTPoint;
- }
- function getUserECoin($user){
-
- $q = 'SELECT CashTotal FROM dbo.CashAccount WHERE UserNum = "'.$user.'"';
- $result = sQuery($q, DB_CC);
- $qECoin = "0";
-
- if (mssql_num_rows($result) == 0) {
-
- $qECoin = "Nothing match";
- }
- else{
-
-
-
- while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
- $qECoin = $row['CashTotal'];
- }
-
- }
- return $qECoin;
-
- }
-
- function getUserPlayTime($user){
-
- $q = 'SELECT PlayTime FROM Account.dbo.cabal_auth_table WHERE UserNum = "'.$user.'"';
- $result = sQuery($q, DB_CC);
- $minutes = 0;
-
- if (mssql_num_rows($result) == 0) {
-
- $minutes = 0;
- }
- else{
- while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
- $minutes = $row['PlayTime'];
- }
- }
-
- $day = floor ($minutes / 1440);
- $hour = floor (($minutes - $day * 1440) / 60);
- $min = $minutes - ($day * 1440) - ($hour * 60);
- $PlayTime = $day."d - ".$hour."h - ".$min."m";
- return $PlayTime;
- }
- function getCharPlayTime($char){
-
- $q = 'SELECT PlayTime FROM Server01.dbo.cabal_character_table WHERE CharacterIdx = "'.$char.'"';
- $result = sQuery($q, DB_CC);
- $minutes = 0;
-
- if (mssql_num_rows($result) == 0) {
-
- $minutes = 0;
- }
- else{
- while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
- $minutes = $row['PlayTime'];
- }
- }
-
- $day = floor ($minutes / 1440);
- $hour = floor (($minutes - $day * 1440) / 60);
- $min = $minutes - ($day * 1440) - ($hour * 60);
- $PlayTime = $day."d - ".$hour."h - ".$min."m";
- return $PlayTime;
- }
-
- function OnlinePlayerNum(){
- $fajl = "cache/online_".date('Y-m-d', strtotime(date('Y-m-d H:i:s'))+ 21600);
- $letezik = True;
- $fileread = (file_exists($fajl))? fopen($fajl, "r") : $letezik = False;
- $sor = 0;
- $current = "";
- $datum = "";
- $szam = 0;
- //Output a line of the file until the end is reached
- if($letezik == True){
- while(!feof($fileread))
- {
- $sor++;
- $szöveg = fgets($fileread);
- $current .= $szöveg;
- if($sor == 1) $datum = $szöveg;
- if($sor == 2) $szam = $szöveg;
- }
- fclose($fileread);
- }
- $currentdate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s'))+ 21600);
- if(abs(strtotime($currentdate) - strtotime($datum)) >= 300){
- $link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- if (!$link) die('Could not connect to MSSQL database.');
-
- mssql_select_db("Server01");
-
- $r=mssql_query("SELECT * FROM dbo.cabal_character_table WHERE Login='1' ");
-
- $row_count = mssql_num_rows( $r );
-
- mssql_free_result($r);
- $filewrite = fopen($fajl, "w") or exit("0");
- // Open the file to get existing content
- // Append a new person to the file
- $kiir = $currentdate."\n".$row_count."\n--------------------\n".$current;
- // Write the contents back to the file
- fwrite($filewrite, $kiir);
- $szam = $row_count;
- }
-
- return($szam);
- }
-
- function GetRegCount($ip){
- $link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- if (!$link) die('Could not connect to MSSQL database.');
-
- mssql_select_db("Account");
-
- $r=mssql_query("SELECT * FROM dbo.cabal_auth_table WHERE IP='$ip' ");
-
- $row_count = mssql_num_rows( $r );
-
- mssql_free_result($r);
-
- return $row_count;
- }
-
-
- function GetVoteIP($voteid, $ip){
- $currentdate = date('Y-m-d H:i:s');
- $link2 = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- $selectdb2 = mssql_select_db('CashShop', $link2);
-
- if (!$selectdb2) die('Could not connect to Database.');
- //Get Votes
- if($voteid == 1){
- $query2 = mssql_query("SELECT votelink1, votedate1, votelink2, votedate2, voteip FROM dbo.Votes WHERE voteip='$ip' ORDER BY [votedate1] Desc ", $link2);
- }
- if($voteid == 2){
- $query2 = mssql_query("SELECT votelink1, votedate1, votelink2, votedate2, voteip FROM dbo.Votes WHERE voteip='$ip' ORDER BY [votedate2] Desc ", $link2);
- }
- if (!mssql_num_rows($query2)) {
- //Write New Line in Votes Table
- return "False";
- }
- else{
- //Get Votes Data
- $qVotelink1 = "";
- $qVotelink2 = "";
- $qVotedate1 = "";
- $qVotedate2 = "";
-
- while ($row = mssql_fetch_array($query2, MSSQL_ASSOC)) {
- $qVotedate1 = $row['votedate1'];
- $qVotedate2 = $row['votedate2'];
- }
- if($voteid == 1){
- if(abs(strtotime($currentdate) - strtotime($qVotedate1)) <= 43200){
- return "True";
- }}
- if($voteid == 2){
- if(abs(strtotime($currentdate) - strtotime($qVotedate2)) <= 43200){
- return "True";
- }
- }
- return "False";
-
- }
- }
- //RANKING
- function ranking_player_honor(){
- $currentdate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s'))+ 21600);
- $link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- $selectdb = mssql_select_db('Server01', $link);
- $kethet = date('Y-m-d H:i:s', strtotime($currentdate) - 1209600);
- echo "<center>Listing from ".$kethet." to ".$currentdate."</center>";
- if (!$selectdb) die('Could not connect to Database.');
- $query=mssql_query("SELECT TOP (100) Name, LEV, Reputation, Login, Nation
- FROM dbo.cabal_character_table
- WHERE (NOT (Nation = '3')) AND (NOT (Name='[T3stR]RaZ00r')) AND ((LogoutTime >= '$kethet') OR (LoginTime >= '$kethet'))
- ORDER BY Reputation DESC, LEV DESC", $link);
-
- // echo "<style> body{ background-color: #000000; background-image: url('images/topback9.png'); color:white; } </style>";
- echo '<table color="white" align="center" style="margin: auto">';
-
- echo '<tr><th width=20>#</th><th width=200>Character</th><th width=30>Lev</th><th width=100>Honour</th><th width=50>Nation</th><th width=50>Online</th></tr>';
- $i = '1';
- while ($row = mssql_fetch_array($query, MSSQL_ASSOC)) {
- echo '<tr align=center>';
- echo '<td>' . $i . '</td>';
- echo '<td>' . $row['Name'] . '</td>';
- echo '<td>' . $row['LEV'] . '</td>';
- echo '<td>' . $row['Reputation'] . '</td>';
- echo '<td>' . NationPic($row['Nation']) . '</td>';
- echo '<td>' . StatusPic($row['Login']) . '</td>';
- echo '</tr>';
- $i++;
- }
- echo '</table>';
- echo '<table>';
- echo '<tr><td><img src=imgs/neut.jpg /></td><td>Neutral</td></tr>';
- echo '<tr><td><img src=imgs/cap.jpg /></td><td>Capella</td></tr>';
- echo '<tr><td><img src=imgs/proc.jpg /></td><td>Procyon</td></tr>';
- echo '</table>';
- mssql_free_result($query);
- }
- function ranking_player_online(){
- $currentdate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s'))+ 21600);
- $kethet = date('Y-m-d H:i:s', strtotime($currentdate) - 1209600);
- echo "<center>Listing from ".$kethet." to ".$currentdate."</center>";
- $link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- $selectdb = mssql_select_db('Server01', $link);
-
- if (!$selectdb) die('Could not connect to Database.');
- $query=mssql_query("SELECT TOP (100) *
- FROM dbo.cabal_character_table
- WHERE (NOT (Nation = '3')) AND (NOT (Name='[T3stR]RaZ00r')) AND ((LogoutTime >= '$kethet') OR (LoginTime >= '$kethet'))
- ORDER BY PlayTime DESC, LEV DESC", $link);
-
- // echo "<style> body{ background-color: #000000; background-image: url('images/topback9.png'); color:white; } </style>";
- echo '<table color="white" align="center" style="margin: auto">';
-
- echo '<tr><th width=20>#</th><th width=200>Character</th><th width=30>Lev</th><th width=160>PlayTime</th><th width=50>Nation</th><th width=50>Online</th></tr>';
- $i = '1';
- while ($row = mssql_fetch_array($query, MSSQL_ASSOC)) {
- echo '<tr align=center>';
- echo '<td>' . $i . '</td>';
- echo '<td>' . $row['Name'] . '</td>';
- echo '<td>' . $row['LEV'] . '</td>';
- echo '<td>' . TimeToStr($row['PlayTime']) . '</td>';
- echo '<td>' . NationPic($row['Nation']) . '</td>';
- echo '<td>' . StatusPic($row['Login']) . '</td>';
- echo '</tr>';
- $i++;
- }
- echo '</table>';
- echo '<table>';
- echo '<tr><td><img src=imgs/neut.jpg /></td><td>Neutral</td></tr>';
- echo '<tr><td><img src=imgs/cap.jpg /></td><td>Capella</td></tr>';
- echo '<tr><td><img src=imgs/proc.jpg /></td><td>Procyon</td></tr>';
- echo '</table>';
- mssql_free_result($query);
- }
- function ranking_guild_score(){
- $currentdate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s'))+ 21600);
- $kethet = date('Y-m-d H:i:s', strtotime($currentdate) - 1209600);
- //echo "<center>Listing from ".$kethet." to ".$currentdate."</center>";
- $link = mssql_connect(DB_ADDR, DB_USER, DB_PASS);
- $selectdb = mssql_select_db('Server01', $link);
-
- if (!$selectdb) die('Could not connect to Database.');
- $query=mssql_query("SELECT TOP (100) *
- FROM dbo.Guild
- WHERE Not GuildName = 'FALLEN'
- ORDER BY Point DESC, Level DESC", $link);
-
- // echo "<style> body{ background-color: #000000; background-image: url('images/topback9.png'); color:white; } </style>";
- echo '<table color="white" align="center" style="margin: auto">';
-
- echo '<tr><th width=20>#</th><th width=200>GuildName</th><th width=30>Level</th><th width=100>Point</th></tr>';
- $i = '1';
- while ($row = mssql_fetch_array($query, MSSQL_ASSOC)) {
- echo '<tr align=center>';
- echo '<td>' . $i . '</td>';
- echo '<td>' . $row['GuildName'] . '</td>';
- echo '<td>' . $row['Level'] . '</td>';
- echo '<td>' . $row['Point'] . '</td>';
- echo '</tr>';
- $i++;
- }
- echo '</table>';
- mssql_free_result($query);
- }
-
- function NationPic($nation){
- switch($nation){
- case 0:
- $return = '<img src=imgs/neut.jpg />';
- break;
- case 1:
- $return = '<img src=imgs/cap.jpg />';
- break;
- case 2:
- $return = '<img src=imgs/proc.jpg />';
- break;
- }
- return $return;
- }
-
- function StatusPic($status){
- switch($status){
- case 0:
- $return = '<img src=imgs/offline.png />';
- break;
- case 1:
- $return = '<img src=imgs/online.png />';
- break;
- }
- return $return;
- }
- function TimeToStr($time){
- $minutes = $time;
- $day = floor ($minutes / 1440);
- $hour = floor (($minutes - $day * 1440) / 60);
- $min = $minutes - ($day * 1440) - ($hour * 60);
- $PlayTime = $day."d - ".$hour."h - ".$min."m";
- return $PlayTime;
- }
- //RaNKING VÉGE
- class Security {
- function secure($string) {
- $pattern1 = "#[^a-z0-9]#";
- if(preg_match($pattern1,$string)==true)
- return false;
- else
- return $string;
- }
- function secUser($username) {
- $pattern2 = "#[^a-z0-9]#";
- if(preg_match($pattern2,$username)==true)
- return false;
- else
- return $username;
- }
- function secPass($password) {
- $pattern3 = "#[^a-zA-Z0-9]#";
- if(preg_match($pattern3,$password)==true)
- return false;
- else
- return $password;
- }
- //Email validator apache 5.2+
- function checkEmail( $email ){
- return filter_var( $email, FILTER_VALIDATE_EMAIL );
- }
- }
- ?>
-