Register for your free account! | Forgot your password?

You last visited: Today at 10:57

  • Please register to post and access all features, it's quick, easy and FREE!


help simple web

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2011
Posts: 19
Received Thanks: 1
Question help simple web

shaiya server
win7 ultimate 32bit
sql server 2008 management studio
appserv 2.6


i used this
LAN: 192.168.1.22
SQL id: godcn
SQL Pass: database55

config.php

Quote:
<?php
//User defined variables
$host = "192.168.1.22"; //Database Host. (IP to DB)
$user = "godcn"; //Database Username
$pass = "database55"; //Database Password
$link = mssql_connect($host,$user,$pass) or die('Connection Error.');
//Custom Function
function mssql_escape_string($data) {
if ( !isset($data) or empty($data) ) return '';
if ( is_numeric($data) ) return $data;

$non_displayables = array(
'/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15
'/%1[0-9a-f]/', // url encoded 16-31
'/[\x00-\x08]/', // 00-08
'/\x0b/', // 11
'/\x0c/', // 12
'/[\x0e-\x1f]/' // 14-31
);
foreach ( $non_displayables as $regex )
$data = preg_replace( $regex, '', $data );
$data = str_replace("'", "''", $data );
return $data;
}

?>

index.php

Quote:
<?php
session_start();
?>
<!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>Account Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="jquery/QapTcha.jquery.css" type="text/css" />
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jquery/jquery-ui.js"></script>
<script type="text/javascript" src="jquery/jquery.ui.touch.js"></script>
<script type="text/javascript" src="jquery/QapTcha.jquery.js"></script>
<script type="text/javascript" src="jquery/jquery.validate.min.js"></script>
<style type="text/css">
form{margin:30px;width:300px}
label{float:left;clear:both;width:100px;margin-top:10px}
input{float:left;margin-top:10px}
.clr{clear:both}
.notice {background-color:#d8e6fc;color:#35517c;border:1px solid #a7c3f0;padding:10px}
.code {
margin:30px;
border:1px solid #F0F0F0;
background-color:#F8F8F8;
padding:10px;
color:#777;
}
.error {color: red; font:10px arial,sans-serif;}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#reg").validate({
debug: false,
rules: {
UserID: "required",
Pw: "required",
Pw2: "required",
},
messages: {
UserID: "Please enter a Username.",
Pw: "Please provide a password.",
Pw2: "Please confirm your password.",
},
submitHandler: function(form) {
$.post('verify.php', $("#reg").serialize(), function(data) {
$('#results').html(data);
$('#UserID').val("");
$('#Pw').val("");
$('#Pw2').val("");
});
}
});
});
</script>
</head>
<body>
<h3>Shaiya Account Registration</h3>
<div id="results" style="list-style-type:none;"></div>
<?php
// if form is submit
if(isset($_POST['submit']))
{
$response = '<div class="notice">';

if(isset($_POST['iQapTcha']) && empty($_POST['iQapTcha']) && isset($_SESSION['iQaptcha']) && $_SESSION['iQaptcha'])
{
$response .= 'Form can be submited';
unset($_SESSION['iQaptcha']);
}
else
$response .= 'Form can not be submited';

$response .= '</div>';

echo $response;
}
?>
<form action="verify.php" id="reg" method="post">
<fieldset>
<label>Username</label> <input name="UserID" maxlength="16" id="UserID" />
<label>Password</label> <input type="password" id="Pw" maxlength="16" name="Pw" />
<label>Confirm Password</label> <input type="password" id="Pw2" maxlength="16" name="Pw2" />
<div class="clr"></div>
<div id="QapTcha"></div>
<input type="submit" name="submit" value="Register" />
</fieldset>
</form>
<script type="text/javascript">
$('#QapTcha').QapTcha({});
</script>
</body>
</html>
verify.php

Code:
<?php
require_once('config.php');
$UserIp = $_SERVER['REMOTE_ADDR'];
$UserID = mssql_escape_string(trim($_POST['UserID']));
$Pw = mssql_escape_string(trim($_POST['Pw']));
$Pw2 = mssql_escape_string(trim($_POST['Pw2']));
$Error = array();
$Success=false;

if (isset($UserID,$Pw,$Pw2)) {
$Try = mssql_query("SELECT * FROM PS_UserData.dbo.Users_Master WHERE UserID = '{$UserID}'") or die('Failed to verify username in Users_Master.');
	
//Verify data exists	
if(empty($UserID)){
	$Error['UserID'] = 'Please provide a user name.';
}else if(strlen($UserID) < 3 || strlen($UserID) > 16){
	$Error['UserID'] = 'Username must be between 3 and 16 characters in length.';
}else if(ctype_alnum($UserID) === false){
	$Error['UserID'] = 'Username must consist of numbers and letters only.';
}else if(mssql_num_rows($Try)){
	$Error['UserID'] = 'Username already exists, please choose a different username.';
}

if(empty($Pw)){
	$Error['Pw'] = 'Please provide a password.';
}else if(strlen($Pw) < 3 || strlen($Pw) > 16){
	$Error['Pw'] = 'Password must be between 3 and 16 characters in length.';
}else if($Pw != $Pw2){
	$Error['Pw2'] = 'Passwords do not match.';
}
	
//Check for errors. If there is none, insert the account into the database.
if(count($Error) == 0){
mssql_query("INSERT INTO PS_UserData.dbo.Users_Master (UserID,Pw,JoinDate,Admin,AdminLevel,UseQueue,Status,Leave,LeaveDate,UserType,Point,UserIp) VALUES ('{$UserID}','{$Pw}',GETDATE(),0,0,0,0,0,GETDATE(),'N',0,'{$UserIp}')");
$Check = mssql_query("SELECT * FROM PS_UserData.dbo.Users_Master WHERE UserID = '{$UserID}'");
if(mssql_num_rows($Check) != 1){$Error[]='Failed to create account';}}
if(count($Error) != 0){foreach($Error as $Errors){echo "<li>".$Errors."</li>";}}else{echo "Account \"".$UserID."\" successfully created!";}
}
?>



when i try to register this is the result

Shaiya Account Registration

Fatal error: Call to undefined function mssql_connect() in C:\AppServ\www\reg\config.php on line 6



@nDroid22 is offline  
Old 08/02/2013, 15:30   #2
 
elite*gold: 0
Join Date: May 2013
Posts: 23
Received Thanks: 15
As your error says, you need to install the mssql libary for php.
look here:


-Torben- is offline  
Old 08/02/2013, 17:48   #3
 
elite*gold: 0
Join Date: Jul 2011
Posts: 19
Received Thanks: 1
Quote:
Originally Posted by -Torben- View Post
As your error says, you need to install the mssql libary for php.
look here:
i will chek this one..

it is for linux??

my sysmtem is win7 ultimate 32bit
SQLserver 2008
php for shaiya registration
@nDroid22 is offline  
Old 08/02/2013, 23:16   #4
 
elite*gold: 0
Join Date: Jan 2013
Posts: 3
Received Thanks: 0
Hello friends someone wants to create a shaiya private sever can add me on facebook roberto carlos moran


robertomoran10 is offline  
Old 08/02/2013, 23:53   #5
 
elite*gold: 0
Join Date: May 2013
Posts: 23
Received Thanks: 15
Quote:
Originally Posted by @nDroid22 View Post
i will chek this one..

it is for linux??

my sysmtem is win7 ultimate 32bit
SQLserver 2008
php for shaiya registration
Its for php. The registration Scripts are running with php on a webserver (or maybe in your case local idk).

But anyway your php version needs a packet so that it can understand the mssql-functions like mssql_connect().

It is obvious that you use windows and microsoft sql-server (mssql) for your server to run. But not every php insatllation can connect to mssql.

Conclusion: So you need a packet/libary for your installed php version on your webserver.
-Torben- is offline  
Old 08/03/2013, 05:19   #6
 
elite*gold: 0
Join Date: Jul 2011
Posts: 19
Received Thanks: 1
Quote:
Originally Posted by -Torben- View Post
Its for php. The registration Scripts are running

It is obvious that you use windows and microsoft sql-server (mssql) for your server to run. But not every php insatllation can connect to mssql.

Conclusion: So you need a packet/libary for your installed php version on your webserver.
what kind of packet /library sir?? do u have a link for it??
thanks for advance...
@nDroid22 is offline  
Old 08/08/2013, 08:27   #7
 
elite*gold: 0
Join Date: Jul 2011
Posts: 19
Received Thanks: 1
problem SOLVE
@nDroid22 is offline  
Old 08/08/2013, 13:40   #8
 
elite*gold: 0
Join Date: May 2013
Posts: 49
Received Thanks: 45
Haha, appache server was fecked up right? thats why your scripts didnt worked.
[ADM]Alcest is offline  
Old 09/07/2013, 06:40   #9



 
elite*gold: 40
Join Date: Dec 2010
Posts: 31,656
Received Thanks: 5,014
Arrow Shaiya -> Shaiya Private Server

#moved

#closed


Autrux is offline  
Closed Thread



« [REQUEST] Non-tradeable item to tradeable | Re-design/Recoloring Item Mall »



All times are GMT +2. The time now is 10:57.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.