[RELEASE] Secure PHP Web Registration Script (MSSQL ODBC)

07/08/2012 03:01 abrasive#1
This is a modernized version of [Only registered and activated users can see links. Click Here To Register...].

It uses a safer method of querying the database that does not rely on escaping input to prevent SQL injection.

The only files that are different from my old registration script are:
db.config.php
register.php
changepass.php

That means if you made changes to the views for the old registration page, you can reuse those same style changes with this registration page just by replacing the view files :)
You will need to put your database credentials into this db.config.php.

You will need to set the RowID column on the Users_Master table to be an auto-increment column.

When using this script treat register.php as the index page. Or rename register.php to index.php if you wish.
07/09/2012 02:17 JohnHeatz#2
#Added to the Index
07/09/2012 03:32 abrasive#3
Quote:
Originally Posted by JohnHeatz View Post
#Added to the Index
Thanks, you could probably replace the link to my old registration page in the index with this one. The only reason to use the old one is if you want to use the php_mssql driver instead of the odbc driver. The php_mssql driver is horribly out of date, so it may be better to steer people to use odbc.
07/12/2012 23:09 .Nexus'#4
Hello , I got this error
"Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'RowID', table 'PS_UserData.dbo.Users_Master'; column does not allow nulls. INSERT fails., SQL state 23000 in SQLExecute in C:\xampp\htdocs\Registration\register.php on line 60"
when i press "Create Account"
can someone help me please ? =)
07/12/2012 23:35 JuuF#5
Quote:
Originally Posted by EpicG4m3r View Post
"Cannot insert the value NULL into column 'RowID', table 'PS_UserData.dbo.Users_Master'; column does not allow nulls. INSERT fails."
B]
I Think your problem is here o,o make it allow nulls :)
07/13/2012 06:00 abrasive#6
Quote:
Originally Posted by JuuF View Post
I Think your problem is here o,o make it allow nulls :)
Actually no, you want to set the RowID column to be auto-increment. This way each row has a unique identifier.
07/31/2012 18:34 erickreq#7
thanks friend thank you very much hopefully everyone were like you who share
1000 tnk
09/15/2012 16:57 patoringa#8
Quote:
Originally Posted by abrasive View Post
You will need to set the RowID column on the Users_Master table to be an auto-increment column.

Hello all! After 1 year, I'm back ;-)
Help, plz. I can not change the autoincrement in RowlD.
There is any sql for this? Manually doesn't work.
I get this message: "Saving change is not permited ......... tables to be dropped and re-created."
But I'm have content in the table.

Thank you all.
09/15/2012 18:03 JohnHeatz#9
Try logging into your SQL with the sa user and password and doing the change, normally that happens due to permissions
09/17/2012 17:55 venon321#10
Quote:
Originally Posted by patoringa View Post
Hello all! After 1 year, I'm back ;-)
Help, plz. I can not change the autoincrement in RowlD.
There is any sql for this? Manually doesn't work.
I get this message: "Saving change is not permited ......... tables to be dropped and re-created."
But I'm have content in the table.

Thank you all.


Fala aew meu querido *-* resolveo volta ao ramo de shaiya rs.
Se quiser akida, estamos aew. um abraço
09/18/2012 12:21 patoringa#11
Quote:
Originally Posted by venon321 View Post
Fala aew meu querido *-* resolveo volta ao ramo de shaiya rs.
Se quiser akida, estamos aew. um abraço
Obrigado. Retornando com força total! ;)
09/19/2012 11:10 cypherxxl#12
How do i set Auto incement ?

Its a noob question i know, but i dont know how to set it in RowID.

Greetings.
09/20/2012 00:23 JohnHeatz#13
[Only registered and activated users can see links. Click Here To Register...]

Do that, I don't think much explanation besides it will be needed
09/20/2012 09:30 cypherxxl#14
Dont work, i dont know why, i cant get it to work...

Code:
'Users_Master' table
- Unable to modify table.  
Cannot insert the value NULL into column 'UserUID', table 'PS_UserData.dbo.Tmp_Users_Master'; column does not allow nulls. INSERT fails.
The statement has been terminated.
09/20/2012 14:09 patoringa#15
Quote:
Originally Posted by JohnHeatz View Post
[Only registered and activated users can see links. Click Here To Register...]

Do that, I don't think much explanation besides it will be needed
:confused: I try it with sa user, but don't work for me too.