[RELEASE] Secure PHP Web Registration Script

06/17/2011 12:08 Kyonhism#91
I don't understand this script . How is the working ? 0_o
06/22/2011 11:21 mss_pretty#92
what need to make with abrasive_registration.rar i am ready with [PS_UserData].[dbo].[Users_Master] but, ddon't know what to make wiht this files :X and waht will is link for register?
06/22/2011 18:27 Churp#93
Hey, trying to get this script working for my server at the moment, and I am getting two annoying errors.

I've put the php files in my htdocs under the folder "abrasive" (so that to access register page I would use "http://127.0.0.1/xampp/abrasive/register.view.php" etc) and when I access this register page, it appears, but at the top I get the error:
Code:
Notice: Undefined variable: errors in C:\xampp\htdocs\xampp\abrasive\register.view.php on line 12
And lower down I get the error:
Code:
Fatal error: Call to undefined function recaptcha_get_html() in C:\xampp\htdocs\xampp\abrasive\register.view.php on line 31
I don't know PHP, but it seems as if the library isn't defining the functions properly.

And yes, before you ask, I have put my recaptcha key in the config for recaptcha, all of the php files are setup, everything should work. I haven't seen anybody ask about these errors and I am wondering if I am misplacing the library for recaptcha?

Here's a picture of what I am seeing, for clarification:

[Only registered and activated users can see links. Click Here To Register...]

Many thanks if you can help me out here, sorry for my lack of experience.

-Churp
06/22/2011 23:08 abrasive#94
Quote:
Originally Posted by Churp View Post
Hey, trying to get this script working for my server at the moment, and I am getting two annoying errors.

I've put the php files in my htdocs under the folder "abrasive" (so that to access register page I would use "http://127.0.0.1/xampp/abrasive/register.view.php" etc) and when I access this register page, it appears, but at the top I get the error:
Code:
Notice: Undefined variable: errors in C:\xampp\htdocs\xampp\abrasive\register.view.php on line 12
And lower down I get the error:
Code:
Fatal error: Call to undefined function recaptcha_get_html() in C:\xampp\htdocs\xampp\abrasive\register.view.php on line 31
I don't know PHP, but it seems as if the library isn't defining the functions properly.

And yes, before you ask, I have put my recaptcha key in the config for recaptcha, all of the php files are setup, everything should work. I haven't seen anybody ask about these errors and I am wondering if I am misplacing the library for recaptcha?

Here's a picture of what I am seeing, for clarification:

[Only registered and activated users can see links. Click Here To Register...]

Many thanks if you can help me out here, sorry for my lack of experience.

-Churp
It looks like you are going to register.view.php instead of register.php. register.view.php is just the display portion, register.php contains all of the logic and includes register.view.php at the end to display the output.
06/23/2011 03:22 Churp#95
Quote:
Originally Posted by abrasive View Post
It looks like you are going to register.view.php instead of register.php. register.view.php is just the display portion, register.php contains all of the logic and includes register.view.php at the end to display the output.
The thing is, if I go to register.php, I get:
Code:
You must have the php_mssql library for Apache installed and enabled
to connect to an MSSQL database. Uncomment
the line that says extension=php_mssql.dll 
in your php.ini (XAMPP/WAMP only). 
This requires a restart of the Apache service 
to take effect.
I've double and triple checked that I have the necessary line uncommented in my php.ini file, and whatever I do, I get this message. It just completely baffles me. :confused:
06/23/2011 04:24 abrasive#96
Quote:
Originally Posted by Churp View Post
The thing is, if I go to register.php, I get:
Code:
You must have the php_mssql library for Apache installed and enabled
to connect to an MSSQL database. Uncomment
the line that says extension=php_mssql.dll 
in your php.ini (XAMPP/WAMP only). 
This requires a restart of the Apache service 
to take effect.
I've double and triple checked that I have the necessary line uncommented in my php.ini file, and whatever I do, I get this message. It just completely baffles me. :confused:
That's an error message I added in because it was a very common dolution to this problem. If you look at the code it is checking if the mssql_connect() function exists, and if not it displays that message. I do not know why but PHP is telling the script that it does not know what the mssql_connect() function is.

I believe in newer versions of WAMP/XAMPP they deprecated that function in favor of a different method. You may want to look for a version prior to PHP version 5.3. But again this is just me guessing as I have rarely used WAMP/XAMPP. Maybe someone else can shed some light on this?
06/23/2011 08:12 RebeccaBlack#97
Quote:
Originally Posted by abrasive View Post
I believe in newer versions of WAMP/XAMPP they deprecated that function in favor of a different method. You may want to look for a version prior to PHP version 5.3. But again this is just me guessing as I have rarely used WAMP/XAMPP. Maybe someone else can shed some light on this?
I haven't used WAMP/XAMPP in a year or two, but as for PHP, I've read that in V5.3, the "mssql" functions are given up, in favor of "odbc" functions.
06/23/2011 09:01 Churp#98
Quote:
Originally Posted by tnelis View Post
I haven't used WAMP/XAMPP in a year or two, but as for PHP, I've read that in V5.3, the "mssql" functions are given up, in favor of "odbc" functions.
Very useful information, from what I remember correctly "WAMP" is the older version of "XAMPP" so I will probably just get that later on when I have time. Glad to know I was hardly at fault for once! ;)

Thanks a lot for the information guys.
06/23/2011 09:21 RebeccaBlack#99
eh, they're nearly the same I believe, just packed differently. See if either gives you information of what PHP version is contained.

WAMP (Windows, Apache, MySQL, PHP)
XAMPP (Cross Platform, Apache, MySQL, PHP, PERL)

I tried searching a bit, both contain PHP 5.3.x, but WAMP you could download older versions from Sourceforge, maybe you'll find more over it, I'm not very knowledgeable with either program, so I'll leave you to it.
06/23/2011 10:08 Svinseladden#100
following this. becouse i get the same with just php in my php manager for iss server 7.5

i have hade ppl looking at this and they all can't understand why this dosn't work.

i get:

You must have the php_mssql library for Apache installed and enabled
to connect to an MSSQL database. Uncomment
the line that says extension=php_mssql.dll
in your php.ini (XAMPP/WAMP only).
This requires a restart of the Apache service
to take effect

all the time when i try to use the register.php. and i have everything installed or added.. i can't understand why mine's not working and i don't have any of the above WAMP/XAMPP installed on the server..
06/23/2011 12:07 Churp#101
Quote:
Originally Posted by tnelis View Post
eh, they're nearly the same I believe, just packed differently. See if either gives you information of what PHP version is contained.

WAMP (Windows, Apache, MySQL, PHP)
XAMPP (Cross Platform, Apache, MySQL, PHP, PERL)

I tried searching a bit, both contain PHP 5.3.x, but WAMP you could download older versions from Sourceforge, maybe you'll find more over it, I'm not very knowledgeable with either program, so I'll leave you to it.
There's a link for XAMPP for downloading older versions as well. I have no idea where to check the PHP version but I guess I will go try and find out, then start downloading different versions of XAMPP until I get one that contains PHP pre-5.3.x.

EDIT: Ok so I've went ahead and downloaded XAMPP 1.7.0 instead of the current which is 1.7.3, and the problem I was having appears to be gone. I had another problem with invalid-request-cookie but I made a stupid mistake with the recaptcha keys. Now I am just getting "Failed to create a new account, please try again later" on the page. Any way to find out what is wrong here?

EDIT2: Removed that "@" in register.php and apparently mssql-query can't insert a NULL value into RowID, as it doesn't allow nulls. Unfortunately I'm not very experienced with the database so I think I might need a little push in the right direction here.
06/23/2011 12:55 Svinseladden#102
my error log say this:

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2011-06-23 10:48:31
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2011-06-23 10:48:31 127.0.0.1 GET /test.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+ Trident/5.0) 500 0 255 2625
2011-06-23 10:48:45 127.0.0.1 GET /register.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+ Trident/5.0) 500 0 255 171
2011-06-23 10:49:58 127.0.0.1 GET /register.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+ Trident/5.0) 500 0 255 156
2011-06-23 10:51:35 127.0.0.1 GET /register.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+ Trident/5.0) 500 0 255 171
2011-06-23 10:52:52 127.0.0.1 GET /register.view.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+ Trident/5.0) 500 0 255 156


anyone know what i can do? i get :

HTTP Error 500.0 - Internal Server Error

C:\Program Files (x86)\PHP\php-cgi.exe - The FastCGI process exited unexpectedly




Module

FastCgiModule



Notification

ExecuteRequestHandler



Handler

PHP_via_FastCGI



Error Code

0x000000ff





Requested URL

[Only registered and activated users can see links. Click Here To Register...]



Physical Path

C:\inetpub\wwwroot\register.view.php



Logon Method

Anonymous



Logon User

Anonymous
06/23/2011 13:33 Churp#103
Where are you getting this error log from? It also looks like you're trying to run register.view.php instead of register.php.

On a side note, before you reply abrasive, my problems with RowID are solved, I set aside my laziness and skimmed through the thread and saw it has already been talked about. Thanks for all the help you've given, very grateful.
06/23/2011 16:50 RebeccaBlack#104
Just out of curiosity, if you're having troubles with the "php_mssql library", copy this into a php file, and navigate to it.

PHP Code:
<?php
//Config for testing
$host '127.0.0.1';
$user 'Shaiya';
$pass 'Shaiya123';

echo 
"<center>";
echo 
"<h3>MSSQL Function Tests</h3>";

//testing for MSSQL function
if(function_exists('mssql_connect')){
echo 
"MSSQL functions existing...";
$mcon mssql_connect($host,$user,$pass);
if(
$mcon){echo "and connections are possible!";}
}else{echo 
"MSSQL functions non existant!";}

echo 
"<br>";

//testing for ODBC function
if(function_exists('odbc_connect')){
echo 
"ODBC functions existing...";
$ocon odbc_connect("Driver={SQL Server};Server=$host;"$user$pass);
if(
$ocon){echo "and connections are possible!";}
}else{echo 
"MSSQL functions non existant!";}

echo 
"<br>";

//Printing PHP Version
echo "PHP version: ".phpversion();

echo 
"<center>";
?>
That should print out something like this, if both work:
Code:
MSSQL Function Tests

MSSQL functions existing...and connections are possible!
ODBC functions existing...and connections are possible!
PHP version: 5.2.17
Yours will be different obviously, as it's likely we'll have different versions, or one/both of those functions will not work.

*Edit* Guess I should have added onto why I wanted people to test this. As most of the PHP packages now are V5.3, I was curious as to how many actually have odbc on by default. If people do have odbc on by default, either I'll release Abrasive's registration, or I'll give to him to release, which I modified to run off of odbc functions, instead of mssql functions. (Technically can be the same thing, just mssql is now "deprecated" in 5.3)

Basically, I'm just polling for how many people have:
  • Both MSSQL/ODBC functions
  • Just MSSQL Functions
  • Just ODBC Functions
  • Neither

and their PHP version, so I can get a better idea of how useful the release of the ODBC registration would be.
06/29/2011 11:25 Svinseladden#105
Quote:
Originally Posted by tnelis View Post
Just out of curiosity, if you're having troubles with the "php_mssql library", copy this into a php file, and navigate to it.

PHP Code:
<?php
//Config for testing
$host '127.0.0.1';
$user 'Shaiya';
$pass 'Shaiya123';

echo 
"<center>";
echo 
"<h3>MSSQL Function Tests</h3>";

//testing for MSSQL function
if(function_exists('mssql_connect')){
echo 
"MSSQL functions existing...";
$mcon mssql_connect($host,$user,$pass);
if(
$mcon){echo "and connections are possible!";}
}else{echo 
"MSSQL functions non existant!";}

echo 
"<br>";

//testing for ODBC function
if(function_exists('odbc_connect')){
echo 
"ODBC functions existing...";
$ocon odbc_connect("Driver={SQL Server};Server=$host;"$user$pass);
if(
$ocon){echo "and connections are possible!";}
}else{echo 
"MSSQL functions non existant!";}

echo 
"<br>";

//Printing PHP Version
echo "PHP version: ".phpversion();

echo 
"<center>";
?>
That should print out something like this, if both work:
Code:
MSSQL Function Tests

MSSQL functions existing...and connections are possible!
ODBC functions existing...and connections are possible!
PHP version: 5.2.17
Yours will be different obviously, as it's likely we'll have different versions, or one/both of those functions will not work.

*Edit* Guess I should have added onto why I wanted people to test this. As most of the PHP packages now are V5.3, I was curious as to how many actually have odbc on by default. If people do have odbc on by default, either I'll release Abrasive's registration, or I'll give to him to release, which I modified to run off of odbc functions, instead of mssql functions. (Technically can be the same thing, just mssql is now "deprecated" in 5.3)

Basically, I'm just polling for how many people have:
  • Both MSSQL/ODBC functions
  • Just MSSQL Functions
  • Just ODBC Functions
  • Neither

and their PHP version, so I can get a better idea of how useful the release of the ODBC registration would be.
MSSQL Function Tests
MSSQL functions non existant!
ODBC functions existing...and connections are possible!

this is what i get. i get the reg up, but i also on the top get:

You must have the php_mssql library for Apache installed and enabled to connect to an MSSQL database. Uncomment the line that says extension=php_mssql.dll in your php.ini (XAMPP/WAMP only). This requires a restart of the Apache service to take effect

when i put in username. when i hit ok (finish username,pass and so on. nothing happends. just get a blank screen where verify should have been.

what is wrong now? and i do not have apache. i have iss php manager

running this on my server. so might just need a restart mabe?