Registration

01/13/2019 15:04 stee1ll#1
Hello to all. I have a problem with registration (screen attached).
I probably always have a problem in config.php
The registration site is located at the mesyan on Pc, the mysql server is on another cospyuter, they are interconnected with HAMACHI. How to do? Mb is there another way to register through the site, srkript, template?

Quote:
<?php
$sql_host="ip pc mysql"; // It can be : localhost\sqlexpress
$sql_user="sa";
$sql_password="";
$Auth_db="Auth";
$md5_key="2011";
$registration = "1";
$max_accounts = "50";
?>
Rummaged the entire forum, and this and that does not work. Perhaps for you it is easy, I have been suffering for a day.

Mistake :
Quote:
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\register\index.php on line 25
index.php
Quote:
<!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>
<title>Arcadia Test Server</title>
<?php
require("conf.php");
if ($registration ==0){
?>
<h1>Registrations closed</h1>
</div>
</div>
<?php
exit;
}
if(isset($_SERVER['HTTP_REFERER'])
&& $_SERVER['HTTP_REFERER']!=''
&& substr($_SERVER['HTTP_REFERER'], 7, strlen($_SERVER['SERVER_NAME'])) != $_SERVER['SERVER_NAME'])
{
$_POST = array();
$_GET = array();
}
function connect(){
require("conf.php");
$db = $Auth_db;
$connect = mssql_connect($sql_host, $sql_user, $sql_password);
if (!$connect) {echo 'connection error'; exit;}
mssql_select_db($db, $connect) or die("Couldn't open database $db");
return $connect;
}
$do = $_POST['do'];
switch($do){
case "register":
$data_array = &$_POST;
$array_char = array("'","/","\\","*",":","!","?",".", "&", "%", "ù","^", "$", "=","¨","}","{","(",")","~","#","[","]","ç","à","é","€","§",";","¤","°","£","`","<",">") ;
$username = $data_array['name'];
$username = str_replace($array_char, "", $username);
$password = $data_array['pwd'];
$password = str_replace($array_char, "", $password);
$passwordconf = $data_array['pwdconf'];
$passwordconf = str_replace($array_char, "", $passwordconf);
$combine_password = $md5_key.$password;
$converted_password = md5($combine_password);
if ($password != $passwordconf){
echo "<span style=\"color:red\">Passwords don't match !</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
if (strlen($username) <= 5){
echo "<span style=\"color:red\">You need 5 characters at least in your account name</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
if (strlen($password) <= 6){
echo "<span style=\"color:red\">You need 5 characters at least in your account password</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
if (strstr ($username, " ") !== False){
echo "<span style=\"color:red\">You need to use alpha/numeric characters! </br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
if (strstr ($password, " ") !== False){
echo "<span style=\"color:red\">You need to use alpha/numeric characters! </br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
$db = connect();
$query_check ="SELECT login_name from Accounts WHERE login_name='$username'";
$query = "INSERT Accounts( login_name,password,block,withdraw_remain_time,age ,auth_ok,pcbang,last_login_server_idx,event_code,r esult ) VALUES('$username','$converted_password',0,0,18,1, 1,1,0,1)";
$query_total = mssql_query("SELECT count(account_id) FROM Accounts");
$results_check = mssql_query($query_check);
$results_total = mssql_fetch_row($query_total);
$result_total = $results_total['0'];
if ($result_total >= $max_accounts){
echo "<span style=\"color:red\">Max accounts limit has been reached, sorry..</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
while ($row_check = mssql_fetch_array($results_check)){
$check_username = $row_check['login_name'];
}
if ($check_username == $username){
echo "<span style=\"color:red\">Account already exist!</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
else
$results = mssql_query($query);
echo "Success, you can now download the launcher</br><a href=\"launcher.exe\">Here</a>, <br />and <a href=\"client.zip\">Client Here</a>";
break;
}
?>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
function refreshpage()
{
setTimeout("location.reload(true);",20);
}
$(document).ready( function ()
{
$("#register").submit( function()
{ // à la soumission du formulaire
$.ajax(
{ // fonction permettant de faire de lajax
type: "POST", // methode de transmission des données au fichier php
url: "index.php", // url du fichier php
data: "do=register&"+"name="+$("#name").val()+"&pwd="+$( "#pwd").val()+"&pwdconf="+$("#pwdconf").val(),// données à transmettre
success: function(msg)
{ // si lappel a bien fonctionné
if (msg)
{
$("div#connexion").hide().fadeIn(1200).html(msg) ;
}
else
{
$("div#erreur").hide().fadeIn(1200).fadeOut(5200). html("<p style=\"color:red\"><img src=\"../client/help/img/error.png\" width=\"20px\" heigth=\"20px\"/>&nbsp;An error occured</p></br>");
}
}
});
return false; // permet de rester sur la même page à la soumission du formulaire
});
});
$(document).ready(function()
{
$("#loadpage").fadeIn(920);
});
</script>
</head>
<body>
<div id="loadpage" style="display:none">
<noscript><div id="loadpage"></div></noscript>
<div style="text-align: center; width: 100%; margin-top: 150px;">
<p>
<img src="logo.png" alt="Arcadia Dev"><br /><h2>NCarbon for Arcadia Dev</h2><br /><br />
</p>
<div id="connexion">
<form name="register" id="register" action="#" class="main_form"><!-- Form begin -->
<div class="main_form">
<label for="name">Username</label>
<div class="div_textbox">
<input type="text" name="name" id="name" /><!-- Login Value -->
</div>
</div>
<div class="main_form">
<label for="pwd">Password</label>
<div class="div_textbox"><!-- Password Field -->
<input type="password" name="pwd" id="pwd" />
</div>
</div>
<div class="main_form">
<label for="pwdconf">Confirm password</label>
<div class="div_textbox">
<input type="password" name="pwdconf" id="pwdconf" /></br>
</div>
</div>
<div class="clear"></div>
<p style="text-align: center; margin: auto; margin-top: 10px;">
<!-- Submit Button -->
<input type="submit" value="Create Account" style="margin: auto;" />
</p>
</form><!-- End of form -->
</div></br>
<div id="erreur"></div><!-- span qui contiendra les éventuels messages derreur -->
<span id="confirmMsg"></span>
</div></div><i>Don't use special char in your password or username, it will be deleted by our internal security system</i></br>
Doin through XAMPP
01/13/2019 17:38 Maks19973#2
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\register\index.php on line 25

as said, your php don't know function mssql_connect and all mssql functions.
You need php5 with support mssql
01/13/2019 20:59 stee1ll#3
Quote:
Originally Posted by Maks19973 View Post
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\register\index.php on line 25

rus:as said, your php don't know function mssql_connect and all mssql functions.
You need php5 with support mssql
бро, просто проблема то наверное не в php, потому что я делал по гайду. Скорее проблема то в том , что XAMPP находится на 1 компе, а сервер и бд mysql на другом компе, соединены они через хамачи. И в config.php я прописал не те данные с бд. Мб есть какой то простой способ сделать регу?)
eng:
bro, just the problem is probably not in php, because I did the guide. Rather, the problem is that XAMPP is on 1 computer, and the server and mysql database on another computer, they are connected via hamachi. And in config.php I registered the wrong data from the database. MB is there any simple way to do the regulation?)
p.s Я играл на твоем сервеxD/
i played on your xD server
01/13/2019 21:09 Zelbov#4
Quote:
Originally Posted by stee1ll View Post
бро, просто проблема то наверное не в php, потому что я делал по гайду. Скорее проблема то в том , что XAMPP находится на 1 компе, а сервер и бд mysql на другом компе, соединены они через хамачи. И в config.php я прописал не те данные с бд. Мб есть какой то простой способ сделать регу?)
eng:
bro, just the problem is probably not in php, because I did the guide. Rather, the problem is that XAMPP is on 1 computer, and the server and mysql database on another computer, they are connected via hamachi. And in config.php I registered the wrong data from the database. MB is there any simple way to do the regulation?)
p.s Я играл на твоем сервеxD/
i played on your xD server
No matter where you host a database, your PHP should support MSSQL driver to connect.

you have php_mssql.dll library extension not installed at all or missing required configuration for PHP to support it.

you're trying to call PHP function that is undefined according to your error output. simple logic: if its an undefined php function, you should do sumn to make it defined php function.

there are a lot of issues with this library though that you can meet, especially with old PHP versions or ntwdblib core library used in PHP itself. i don't remember all of them at all but i can advice: it's a deprecated, not currently maintained library that has a lot of modern analogs, as like [Only registered and activated users can see links. Click Here To Register...] driver library.

honestly, you better learn how to work with newer tools than learn how to maintain deprecated ones if you never did and dont completely understand how to do that.

EDIT: don't use XAMPP. it's a quite simply installed tool but it has a lot of deprecated packages that are hard to maintain and designed for local server web projects testing, not for production usage. especially take a loot at [Only registered and activated users can see links. Click Here To Register...] found whose are so stupid to use this product for a serious project
01/13/2019 21:20 rz-crazyfun#5
what else do you have in your pocket from 2010:lul:? with ez leak db.
01/13/2019 22:02 stee1ll#6
Thank you, how difficult it is to be the developer of a site, server, php html coder to understand mysql))
01/13/2019 22:07 Zelbov#7
Quote:
Originally Posted by stee1ll View Post
Thank you, how difficult it is to be the developer of a site, server, php html coder to understand mysql))
well yeah, especially when you use readymade scripts from Noah epoch lol :D
01/13/2019 22:38 Maks19973#8
Quote:
Originally Posted by stee1ll View Post
бро, просто проблема то наверное не в php, потому что я делал по гайду. Скорее проблема то в том , что XAMPP находится на 1 компе, а сервер и бд mysql на другом компе, соединены они через хамачи. И в config.php я прописал не те данные с бд. Мб есть какой то простой способ сделать регу?)
eng:
bro, just the problem is probably not in php, because I did the guide. Rather, the problem is that XAMPP is on 1 computer, and the server and mysql database on another computer, they are connected via hamachi. And in config.php I registered the wrong data from the database. MB is there any simple way to do the regulation?)
p.s Я играл на твоем сервеxD/
i played on your xD server
Как тебе уже сказали проблема в твоём php который не поддерживает функции mssql

eng
as all said, problem on your php, because it does not support mssql functions
01/14/2019 09:28 stee1ll#9
Quote:
Originally Posted by Zelbov View Post
well yeah, especially when you use readymade scripts from Noah epoch lol :D
And where is the script to find?) I have already rummaged through the entire Internet
01/14/2019 12:50 ThunderNikk#10
I think they are trying to tell you that you need to update the PHP version you are using to have support for mssql_connect
01/14/2019 21:44 Zelbov#11
Quote:
Originally Posted by stee1ll View Post
And where is the script to find?) I have already rummaged through the entire Internet
not the point. the point is: you say "it's hard to be a dev", when you use readymade stuff you didn't develop. it's not related to dev at all, its administrative stuff.

that was a joke mate. but nevermind :P
01/14/2019 22:23 Xijezu#12
mssql_* is outdated and not supported anymore. Stop using it and use [Only registered and activated users can see links. Click Here To Register...] for example.

And yes, the error message tells you that you don't have the mssql-Library installed for PHP. Everything else said in this thread is wrong.

Don't downgrade, don't install the mssql-Library, just... update the code. Everything else will cause more problems.
01/17/2019 02:36 Min@to#13
I think you should use sqlsrv Check this [Only registered and activated users can see links. Click Here To Register...].

PHP Code:
#1 Connect using Windows Authentication.
<?php
$serverName 
"serverName\sqlexpress"//serverName\instanceName

// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array( "Database"=>"dbName");
$conn sqlsrv_connect$serverName$connectionInfo);

if( 
$conn ) {
     echo 
"Connection established.<br />";
}else{
     echo 
"Connection could not be established.<br />";
     die( 
print_rsqlsrv_errors(), true));
}
?>

#2 Connect by specifying a user name and password.
<?php
$serverName 
"serverName\sqlexpress"//serverName\instanceName
$connectionInfo = array( "Database"=>"dbName""UID"=>"userName""PWD"=>"password");
$conn sqlsrv_connect$serverName$connectionInfo);

if( 
$conn ) {
     echo 
"Connection established.<br />";
}else{
     echo 
"Connection could not be established.<br />";
     die( 
print_rsqlsrv_errors(), true));
}
?>
01/17/2019 12:37 c1ph3r#14
Quote:
Originally Posted by Xijezu View Post
mssql_* is outdated and not supported anymore. Stop using it and use [Only registered and activated users can see links. Click Here To Register...] for example.

And yes, the error message tells you that you don't have the mssql-Library installed for PHP. Everything else said in this thread is wrong.

Don't downgrade, don't install the mssql-Library, just... update the code. Everything else will cause more problems.
And don't use xampp! There are several security issues.