[ADVANCED] Registration Script / SQLSRV

01/02/2012 23:59 ismokedrow#1
-- Forewarning --

The following is in no way shape or form intended for the use of beginners and requires basic and intermediate skill levels to apply and use.

-- Features --
  • Username Check
  • Password Confirm
  • Password MD5 Encryption
  • Age Field (For Server using; Adult Server)
  • Email Field (Useful for Verifying Accounts / Blocking Dual Accounts)
  • Email Check (Cuts down on Dual Accounters)
  • IP Post (Posts the users IP to the IP field in the Accounts Database upon Account Creation) [Invisible to User]
  • IP Check (Cuts down on Dual Accounters)

-- Why do I need SQLSRV? --

MSSQL was dropped in PHP v5.3 -- the old registration scripts first put out in this community are designed to use the MSSQL_connect or MSSQL api. This can negatively impact the over-all performance of your website and is an inconvience. The SQLSRV Api was created as a replacement of the archaic MSSQL api, the syntax does not very all that greatly but did take a great deal of rewriting.

-- What do I need? --

To use this script your machine must be running PHP v5.3.8 (The Newest Version of XAMPP uses this version of PHP) and you must have SQLSRV 2.0 Installed.

!!XAMPP!! !!WARNING!! - Do NOT install in C:\Program Files or C:\Program Files (x86) install in C:\

You can get the latest version of XAMPP: [Only registered and activated users can see links. Click Here To Register...]

!!WARNING!!

SQLSRV2 requires that MS SQL Server Native Client 2008 R2 also be installed.

You can get this from [Only registered and activated users can see links. Click Here To Register...]

-- Installing SQLSRV 2.0 + Configuring your PHP.INI --

Download the requires DLL's + PHP.ini: [Only registered and activated users can see links. Click Here To Register...]

You will need to copy the PHP.ini to your XAMPP's PHP folder (Please overwrite if asked)

Move the other two files into your XAMPPS PHP\Ext folder, reload your server.

-- Configuring the Registration Script --

Download the SQLSRV Registration Script: [Only registered and activated users can see links. Click Here To Register...]

Copy 'index.php' to your web root e.g. 'htdocs' for XAMPP

Copy the 'function' folder into your web root as-well.

Open index.php and scroll down to:

Code:
function connect(){
						$serverName = "serverName\instanceName"; // Replace with your Computer Name \ Instance Name e.g. localhost\SQLEXPRESS
						$usr="username"; // Replace 'Username' with the SQL User Name for your Account Database
						$pwd="password"; // Replace 'Password' with the SQL Password for your Account Database
						$db="server_name"; // Replace 'server_name' with the name of your account database e.g. Auth
						$connectionInfo = array("UID" => $usr, "PWD" => $pwd, "Database" => $db);
						$conn = sqlsrv_connect($serverName, $connectionInfo);
						 if( $conn )
						 {
						 echo "Connection established.\n";
						 }
						 else
						 {
						 echo "Connection could not be established.\n";
						 die( print_r( sqlsrv_errors(), true));
						 } 
						 return $conn;
}
Change the username, password and server_name with the details of your server. Save.

Open the conf.php in your 'function' folder edit the information you desire, save.

Restart your web server to ensure the changes have taken place.

-- Credits --

This script was originally designed by Demonroro.
This script was rewritten, optimized and converted to SQLSRV by iSmokeDrow
This script has been tested and confirmed functional.

Enjoy,
iSmokeDrow

If you found this post useful or enjoy my work be a sport and press the "Thanks" button.
01/03/2012 14:58 qaaah#2
thx againe
01/03/2012 15:55 montah2050#3
thanx you very much you are the best ^_^
01/03/2012 16:39 AndrioX9#4
thank you very much you made a nice effort :)
01/04/2012 15:10 KillerBeet#5
in zeile 35 wo drine steht :"$do = $_POST['do'];"
hatter ein fehler ...
wo kann das problem liegen ?
01/04/2012 16:35 ismokedrow#6
It's a notice not an error. Furthermore you can disable this error by Googling PHP Disable Notices...
01/04/2012 21:02 Makenci#7
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\index.php on line 25

line 25 is = $connect = mssql_connect($sql_host, $sql_user, $sql_password);


whats is wrong -.-
01/05/2012 16:17 mcartur009#8
pls held habe den fehler in zeile 35 auch :"$do = $_POST['do'];"
wie beseitige ihn den denn Ö.ö
01/05/2012 20:03 OtakuTxie#9
Quote:
Originally Posted by Makenci View Post
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\index.php on line 25

line 25 is = $connect = mssql_connect($sql_host, $sql_user, $sql_password);


whats is wrong -.-
Did you change the config file and enter your information? $sql_host should be YOURPCNAME\SQLExpress $sql_user should be sa and $sql_password should be whatever you set the password for your 'sa' user.
01/06/2012 14:57 elco2100#10
Quote:
Originally Posted by Makenci View Post
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\index.php on line 25

line 25 is = $connect = mssql_connect($sql_host, $sql_user, $sql_password);


whats is wrong -.-
That cant be right, shut be sqlsrv_connect Not mssql_connect.
Or youre not running the right script.:confused:
01/16/2012 20:18 Gold.D.Marko#11
Thank You But Were I Get Web Root?
Copy the 'function' folder into your web root as-well.
01/17/2012 00:59 s0ul37#12
Rent one. [Only registered and activated users can see links. Click Here To Register...]
01/17/2012 10:49 Gold.D.Marko#13
Not Free?
01/17/2012 11:00 Xijezu#14
Sure, you just hadn't look at all of this page.

There is a Root-Server with 64gb ram, 16 chip processor, 1000mbit/s, no traffic-limit, 24/7 direct support, just 1 person for you, also 3 serveradmins which will sit next to your root, so it always stays online. :facepalm:

No, rootserver aren't free.... -_-
01/17/2012 18:13 bwr_62#15
Thanks, but i don't press the "Confirm" button :/