Probleme bei der Verwendung von MSSQL in der Verbindung mit XAMPP

KevinsComputer

New Member
Hallo erstmal.

Vorab die LoginDaten sind richtig und funktionieren auch.

Es kommt XAMPP Windows Version 1.7.1 zum Einsatz.

Habe das Problem das MSSQL einfach nicht richtig funktionieren will.

Folgende Ausgaben erhalte ich


PHP:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 127.0.0.1 in C:\xampp\htdocs\site\shop\verify.php on line 25

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in C:\xampp\htdocs\site\shop\verify.php on line 26

Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in C:\xampp\htdocs\site\shop\verify.php on line 28

Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in C:\xampp\htdocs\site\shop\verify.php on line 28

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\xampp\htdocs\site\shop\verify.php on line 29

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in C:\xampp\htdocs\site\shop\verify.php on line 33

Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in C:\xampp\htdocs\site\shop\verify.php on line 34

Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in C:\xampp\htdocs\site\shop\verify.php on line 34

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\xampp\htdocs\site\shop\verify.php on line 36

Warning: mssql_close(): supplied argument is not a valid MS SQL-Link resource in C:\xampp\htdocs\site\shop\verify.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\site\shop\verify.php:25) in C:\xampp\htdocs\site\shop\verify.php on line 45

So sieht die Config aus.

<?php
//Edit this part
$server = "127.0.0.1"; // Your SQL server IP
$username = "sa"; // Your SQL username(often root)
$password = "nawaswohl?"; // Your SQL password.
//Do not edit the following
$db = "ACCOUNT_DBF"; // Shop Database
$flyffdb = "ACCOUNT_DBF"; // Account Database
$flyffdb2 = "CHARACTER_01_DBF"; // Character Database
?>

Und die verify.php

PHP:
<?php 
function antisql( $data )
  {
    $data = str_replace( "'", "''", $data );
    $data = htmlentities( $data );
    return( $data );
  }
$user = antisql($_POST['user']);
$pass = antisql($_POST['pass']);
$char = antisql($_POST['char']);
session_start();
$_SESSION['user'] = $user;
$_SESSION['char'] = $char;
$_SESSION['pass'] = $pass;

	// Error Proccessing with fix=1 Login Issue on login.php
	if (!isset($user) || !isset($pass) || !isset($char)) {
	header( "Location: index.php?fix=1" );
	}
	//check that the form fields are not empty, and redirect back to the login page if they are also give an error fix=1
	elseif (empty($user) || empty($pass)|| empty($char)) {
	header( "Location: index.php?fix=1" );
	} else {
	include "config.php";
	$con = mssql_connect($server,$username,$password);
	mssql_select_db($flyffdb, $con);
	$passmd5 = md5("kikugalanet$pass");
	$result = mssql_query("SELECT * FROM [ACCOUNT_TBL] WHERE account='$user' and password='$passmd5'");
	$row = mssql_fetch_array($result);
	$id = $row['id'];
	$user_id = $row['account'];
	$user_pw = $row['password'];
	mssql_select_db($flyffdb2, $con);
	$result2 = mssql_query("SELECT * FROM [CHARACTER_TBL] WHERE m_szName='$char'");
	$logged_in = $row['isuse'];
	$row2 = mssql_fetch_array($result2);
	$char_id = $row2['m_szName'];
	$acc_id = $row2['account'];
		mssql_close($con);
		$_SESSION['id'] = $id;	
		$_SESSION['logged_in'] = $logged_in;
	// Check if Username Match to the database. If doesnt match error fix=1 located in login.php form	
	if($user != $user_id || $passmd5 != $user_pw){
	//echo "Login Issue Try again.<br />";
	header("Location: index.php?fix=1");
	} else {
	//echo "Successful Login.<br />";
	// Check if Character Match to the database.  If doesnt match error fix=3 located in login.php form	
	if ($char != $char_id){
	//echo "Not Valid Character.<br />";
	header("Location: index.php?fix=2");
	} else {
	//echo "Successful Character.<br />";
	// Check if Character is on owner account on the database. If doesnt match error fix=4 located in login.php form	
	if ($user != $acc_id){
	//echo "Account Don't Belong to you. You Theif IP BAN MUAHAHAH!<br />";
	header("Location: index.php?fix=3");
	} else {
	//echo "Successful Account Character Belong to you.<br />";
	header("Location: shop.php");
	//echo $user_buff;
	}
	}
	}
	}	
?>

Hoffe mir kann da jemand helfen.

Danke
 
Back
Top