I want to create a connection from the webserver to the rootserver which have a mssql server. If I put the register script on the rootserver it works but if I wanna put the register script on the webserver it don´t work, ODBC settings on the server are correct.
$connect = odbc_connect("Driver={SQL Server Native Client 10.0}; ServerName={$server}; Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");
function valida_email($email) {//Funktion um das Format der E-Mail zu bestätigen! if (preg_match('/^[A-Za-z0-9-_.+%]+@[A-Za-z0-9-.]+\.[A-Za-z]{2,4}$/', $email)) return true; else return false; }
$result = odbc_exec($connect, "SELECT name FROM dbo.Account WHERE name = '$userid'"); $existing_users = odbc_num_rows($result); if($existing_users >= 1) {//Überprüft, ob das Konto noch nicht existiert! header("location:accal.html"); }
$result2 = odbc_exec($connect, "SELECT email FROM dbo.Account WHERE email = '$email'"); $existing_email = odbc_num_rows($result2); if($existing_email >= 1) {//Überprüft, ob die E-Mail nicht in Gebrauch ist! header("location:accal2.html"); }
if (!$_POST['username'] ) {//Schaut dass kein Feld leer ist! header("location:accal3.html"); die();
}
if (!$_POST['password'] ) {//Schaut dass kein Feld leer ist! header("location:accal3.html"); die(); }
if (!$_POST['email'] ) {//Schaut dass kein Feld leer ist! header("location:accal3.html"); die(); }
if (!$_POST['secret'] ) {//Schaut dass kein Feld leer ist! header("location:accal3.html"); die(); }
if (!$_POST['resp'] ) {//Schaut dass kein Feld leer ist! header("location:accal3.html"); die(); }
if($_POST['password'] != $_POST['password_conf']) { // Wir überprüfen, ob die eingegebenen Kennwörter übereinstimmen header ("location:accal5.html"); die(); }
if(!valida_email($_POST['email'])) { // überprüfen, ob die eingegebene E-Mail korrekt ist header("location:accal2b.html"); die(); }
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib 'SQL Server Native Client 10.0' : file not found, SQL state 01000 in SQLConnect in /www/htdocs/MyUserName/MyDomain/register-ingame/register.php on line 8
Can't connect the MSSQL server.
An advice: Dont use odbc
I use alot of mssql because Dekaron an rpg i develop, uses alot of mssql and while im creating websites i just connect like this :
PHP Code:
//config here like yours
$con = mssql_connect($site_config['host'],$site_config['user'],$site_config['pass']);
Just do a connect and when you make a query just call it
An advice: Dont use odbc
I use alot of mssql because Dekaron an rpg i develop, uses alot of mssql and while im creating websites i just connect like this :
PHP Code:
//config here like yours
$con = mssql_connect($site_config['host'],$site_config['user'],$site_config['pass']);
Just do a connect and when you make a query just call it
Thanks, I will try it. But where do I add that he must connect to another server? I must insert the server ip of the other server, thats why I need odbc I guess
What do you mean with connect to another server? You mean sql instance or another ip? And i cant get the point of needing another ip.
So you are trying to connect to a server or for 2 at same time.. Its quite confused xd
The mysql is on the webserver with the register script. The gameserver with the mssql server is on another server, also registerscript is on the url webserver.elitepvpers.com (samplepage) and the gameserver with mssql is on gameserver.elitepvpers.com
Now I need a connection from webserver to gameserver, so I must add a IP to the gameserver on my webserver that he can write the datas in the mssql server
If you are using PHP, just use PDO. Using prepared statements prevents injections. This will protect you from nearly all injection types. You can google for the various other adjustments/settings you can use to prevent from the rest. But using a random regex check on a query is not the way to protect yourself.
mssql connection? 05/16/2014 - Dekaron Private Server - 5 Replies Hello again,
I tried to configure my homepage to connect to my dedicated server (sql server DB 2000) with this:
$GLOBALS = mssql_connect("178.33.XXX.XX","USER ","PW");
/**
* Check connection
*/
mssql/Odbc Connection 01/16/2013 - Rappelz Private Server - 5 Replies I found a top 100 ranking script including a mssql_connect
is there a way to make it a odbc connection instead of mssql?
if not can anyone tell me how this should be connected to the server like mssql_connect
<?php
$host="......";
$user = ".....";
$pw = "...";
MSSQL Connection unter IIS 06/12/2011 - Flyff Private Server - 11 Replies Guten Tag liebe ePvpers-Gemeinde,
Ich habe nun PHP unter IIS zum laufen gebracht, ohne probleme nun hab ich folgendes Problem:
Wenn ich ein Register-Script einbaue und alles ausfülle gelange ich nur auf eine Error Seite, der Error lautet 500 das Ressourcen nicht zu finden wären. In der PHP.ini gibts steht nichts von der MSSQL.dll (genaue name nicht im kopf). Damit das klappen könnte.
Jemand eine Idee? :/